fix linux build
This commit is contained in:
10
3rdParty/msdf/CMakeLists.txt
vendored
10
3rdParty/msdf/CMakeLists.txt
vendored
@@ -76,12 +76,20 @@ FetchContent_MakeAvailable(msdfgen_atlas)
|
||||
function(LinkMsdf TARGET)
|
||||
if(WIN32)
|
||||
set(STATIC_LIB_EXT "lib")
|
||||
set(freetype_lib_name "freetype")
|
||||
else()
|
||||
set(STATIC_LIB_EXT "a")
|
||||
set(freetype_lib_name "libfreetype")
|
||||
endif()
|
||||
|
||||
# link freetype first to fix linkage issues on linux
|
||||
target_link_libraries(${TARGET} PUBLIC "${VCPKG_SRC_DIR}/installed/${TRIPLET}/lib/${freetype_lib_name}.${STATIC_LIB_EXT}")
|
||||
file(GLOB installed_libs "${VCPKG_SRC_DIR}/installed/${TRIPLET}/lib/*.${STATIC_LIB_EXT}")
|
||||
foreach(lib ${installed_libs})
|
||||
target_link_libraries(${TARGET} PUBLIC ${lib})
|
||||
get_filename_component(libname ${lib} NAME_WE)
|
||||
if (NOT ${libname} STREQUAL ${freetype_lib_name})
|
||||
target_link_libraries(${TARGET} PUBLIC ${lib})
|
||||
endif()
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user