From 745da6ba453795c50b75225b23b6875937f8cb98 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Fri, 30 Dec 2022 11:24:53 +0100 Subject: [PATCH] build: Only use `--export-all-symbols` on Windows --- lib/libimhex/CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/libimhex/CMakeLists.txt b/lib/libimhex/CMakeLists.txt index 0c3ac565b..3929d5f9c 100644 --- a/lib/libimhex/CMakeLists.txt +++ b/lib/libimhex/CMakeLists.txt @@ -154,12 +154,14 @@ add_compile_definitions(IMHEX_PROJECT_NAME="${PROJECT_NAME}") add_library(libimhex SHARED ${LIBIMHEX_SOURCES}) set_target_properties(libimhex PROPERTIES POSITION_INDEPENDENT_CODE ON) setupCompilerWarnings(libimhex) -target_link_options(libimhex PRIVATE -Wl,--export-all-symbols) + target_include_directories(libimhex PUBLIC include ${XDGPP_INCLUDE_DIRS} ${MBEDTLS_INCLUDE_DIRS} ${CAPSTONE_INCLUDE_DIRS} ${MAGIC_INCLUDE_DIRS} ${LLVM_INCLUDE_DIRS} ${FMT_INCLUDE_DIRS} ${CURL_INCLUDE_DIRS} ${YARA_INCLUDE_DIRS}) target_link_directories(libimhex PUBLIC ${MBEDTLS_LIBRARY_DIR} ${CAPSTONE_LIBRARY_DIRS} ${MAGIC_LIBRARY_DIRS}) -if (APPLE) +if (WIN32) + target_link_options(libimhex PRIVATE -Wl,--export-all-symbols) +elseif (APPLE) find_library(FOUNDATION NAMES Foundation) target_link_libraries(libimhex PUBLIC ${FOUNDATION}) endif ()