From ab8af53059ac0374cfba08496d3b2194d57502a2 Mon Sep 17 00:00:00 2001 From: Izzy Muerte <63051+bruxisma@users.noreply.github.com> Date: Thu, 20 Oct 2022 13:35:04 -0700 Subject: [PATCH] Fix exported symbols under clang-cl (Closes #503) This also turns the define for PUGIXML_API into an `$`, instead of an `$` with an empty true condition. If this is inadequate, I will undo it, and place them on separate lines as they were before, but will most likely use an inverse `$` instead of an `$`. --- CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d309509..77a5e7e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -101,6 +101,10 @@ if (BUILD_SHARED_LIBS) ${PROJECT_SOURCE_DIR}/src/pugixml.cpp) add_library(pugixml::shared ALIAS pugixml-shared) list(APPEND libs pugixml-shared) + string(CONCAT pugixml.msvc $, + $ + >) set_property(TARGET pugixml-shared PROPERTY EXPORT_NAME shared) target_include_directories(pugixml-shared @@ -111,8 +115,7 @@ if (BUILD_SHARED_LIBS) ${PUGIXML_BUILD_DEFINES} ${PUGIXML_PUBLIC_DEFINITIONS} PRIVATE - $<$:PUGIXML_API=__declspec\(dllexport\)> - $,,PUGIXML_API=__attribute__\(\(visibility\("default"\)\)\)> + PUGIXML_API=$ ) target_compile_options(pugixml-shared PRIVATE