diff --git a/cmake/custom/static_library.cmake b/cmake/custom/static_library.cmake index 22c2a0395..946377bc8 100644 --- a/cmake/custom/static_library.cmake +++ b/cmake/custom/static_library.cmake @@ -44,7 +44,7 @@ if(ENABLE_GENERIC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libstdc++ -static-libgcc") endif() if(CMAKE_C_COMPILER_ID MATCHES Intel) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libstdc++ -static-libgcc -static-intel -wd10237") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--as-needed -static-libstdc++ -static-libgcc -static-intel -wd10237") endif() if(CMAKE_C_COMPILER_ID MATCHES Clang) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libstdc++") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fff6cb8a4..2f6ec5c12 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -28,7 +28,7 @@ if(NOT STATIC_LIBRARY_ONLY) set_target_properties(pcm-base PROPERTIES POSITION_INDEPENDENT_CODE 1 INTERPROCEDURAL_OPTIMIZATION 1) add_library(pcm-shared SHARED $ $) - target_link_libraries(pcm-shared ${ZLIB_LIBRARIES}) + target_link_libraries(pcm-shared ${ZLIB_LIBRARIES} ${LIBC_INTERJECT}) set_target_properties(pcm-shared PROPERTIES SOVERSION ${PROJECT_VERSION_MAJOR} CLEAN_DIRECT_OUTPUT 1 OUTPUT_NAME "pcm") install(TARGETS pcm-shared DESTINATION lib) endif()