Skip to content

Commit

Permalink
Merge pull request #525 from bruxisma/master
Browse files Browse the repository at this point in the history
Fix exported symbols under clang-cl (Closes #503)
  • Loading branch information
zeux authored Oct 21, 2022
2 parents 86c9105 + ab8af53 commit 43ef7e2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 43ef7e2

Please sign in to comment.