Fix clang linker problem by defining POCO_NO_AUTOMATIC_LIBS (#3177)

This commit is contained in:
linquize 2022-01-04 16:46:50 +08:00 committed by GitHub
parent f810bd0b41
commit ff3ff01f6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -22,6 +22,11 @@ target_include_directories(CppUnit
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src
)
if(WIN32)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
target_compile_definitions(CppUnit PUBLIC POCO_NO_AUTOMATIC_LIBS)
endif()
endif()
if(NOT BUILD_SHARED_LIBS)
target_compile_definitions(CppUnit

View File

@ -137,6 +137,9 @@ endif()
if(WIN32)
target_compile_definitions(Foundation PUBLIC POCO_OS_FAMILY_WINDOWS UNICODE _UNICODE)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
target_compile_definitions(Foundation PUBLIC POCO_NO_AUTOMATIC_LIBS)
endif()
target_link_libraries(Foundation PUBLIC iphlpapi)
endif()