From b76ad05a533ee770f7d4cf01589d48a03ef0be2e Mon Sep 17 00:00:00 2001 From: niansa Date: Tue, 12 Mar 2024 22:02:00 +0100 Subject: [PATCH] Link to LLVM statically --- src/common/CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 3baae5a30d..05dc4a5209 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -254,8 +254,14 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") ) endif() +function (target_link_static_library TARGET MODE LIBRARY) + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX}) + target_link_libraries(${TARGET} ${MODE} ${LIBRARY}) +endfunction() + target_link_libraries(common PUBLIC Boost::context Boost::headers fmt::fmt microprofile stb::headers Threads::Threads) -target_link_libraries(common PRIVATE lz4::lz4 zstd::zstd LLVM::Demangle) +target_link_libraries(common PRIVATE lz4::lz4 zstd::zstd) +target_link_static_library(common PRIVATE LLVM::Demangle) if (ANDROID) # For ASharedMemory_create