diff options
author | Izzy Muerte <63051+bruxisma@users.noreply.github.com> | 2022-10-20 13:35:04 -0700 |
---|---|---|
committer | Izzy Muerte <63051+bruxisma@users.noreply.github.com> | 2022-10-20 13:35:49 -0700 |
commit | ab8af53059ac0374cfba08496d3b2194d57502a2 (patch) | |
tree | 3560bbff462f3df696b5535eea47f856c5d38a7a /CMakeLists.txt | |
parent | 86c91051541d18a0d24b837a866cf0306fc8db1a (diff) | |
download | pugixml-ab8af53059ac0374cfba08496d3b2194d57502a2.zip pugixml-ab8af53059ac0374cfba08496d3b2194d57502a2.tar.gz pugixml-ab8af53059ac0374cfba08496d3b2194d57502a2.tar.bz2 |
Fix exported symbols under clang-cl (Closes #503)
This also turns the define for PUGIXML_API into an `$<IF:>`, instead of an
`$<IF:>` 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 `$<NOT:>` instead of an `$<IF:>`.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 7 |
1 files 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 $<OR: + $<STREQUAL:${CMAKE_CXX_COMPILER_FRONTEND_VARIANT},MSVC>, + $<CXX_COMPILER_ID: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 - $<$<CXX_COMPILER_ID:MSVC>:PUGIXML_API=__declspec\(dllexport\)> - $<IF:$<CXX_COMPILER_ID:MSVC>,,PUGIXML_API=__attribute__\(\(visibility\("default"\)\)\)> + PUGIXML_API=$<IF:${pugixml.msvc},__declspec\(dllexport\),__attribute__\(\(visibility\("default"\)\)\)> ) target_compile_options(pugixml-shared PRIVATE |