From 8c1b0dc8abab2e9d6f421d53deb445b2d8f0f6c5 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 22 May 2018 17:56:13 +0200 Subject: [PATCH] chore(CMakeLists.txt): export Xerces symbols on Windows --- src/CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d05cfd3a9..531f7c16f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -436,8 +436,12 @@ if(ENABLE_SHARED) if(APPLE) target_link_libraries(linphone PRIVATE "-framework Foundation" "-framework AVFoundation") endif() - if(WIN32 AND CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone" AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - set_target_properties(linphone PROPERTIES PREFIX "lib") + if(WIN32) + # Export Xerces symbols. + list(APPEND LINPHONE_CXX_OBJECTS_DEFINITIONS "-DDLL_EXPORT") + if(CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone" AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + set_target_properties(linphone PROPERTIES PREFIX "lib") + endif() elseif(ANDROID) target_link_libraries(linphone PUBLIC "log" ${SUPPORT_LIBRARIES} ${CPUFEATURES_LIBRARIES}) endif() @@ -457,6 +461,8 @@ if(ENABLE_SHARED) PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE ) endif() +target_compile_definitions(linphone PRIVATE ${LINPHONE_CXX_OBJECTS_DEFINITIONS}) + if(ICONV_FOUND) if(APPLE) # Prevent conflict between the system iconv.h header and the one from macports.