Skip to content

Commit 43ef7e2

Browse files
authored
Merge pull request #525 from bruxisma/master
Fix exported symbols under clang-cl (Closes #503)
2 parents 86c9105 + ab8af53 commit 43ef7e2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ if (BUILD_SHARED_LIBS)
101101
${PROJECT_SOURCE_DIR}/src/pugixml.cpp)
102102
add_library(pugixml::shared ALIAS pugixml-shared)
103103
list(APPEND libs pugixml-shared)
104+
string(CONCAT pugixml.msvc $<OR:
105+
$<STREQUAL:${CMAKE_CXX_COMPILER_FRONTEND_VARIANT},MSVC>,
106+
$<CXX_COMPILER_ID:MSVC>
107+
>)
104108

105109
set_property(TARGET pugixml-shared PROPERTY EXPORT_NAME shared)
106110
target_include_directories(pugixml-shared
@@ -111,8 +115,7 @@ if (BUILD_SHARED_LIBS)
111115
${PUGIXML_BUILD_DEFINES}
112116
${PUGIXML_PUBLIC_DEFINITIONS}
113117
PRIVATE
114-
$<$<CXX_COMPILER_ID:MSVC>:PUGIXML_API=__declspec\(dllexport\)>
115-
$<IF:$<CXX_COMPILER_ID:MSVC>,,PUGIXML_API=__attribute__\(\(visibility\("default"\)\)\)>
118+
PUGIXML_API=$<IF:${pugixml.msvc},__declspec\(dllexport\),__attribute__\(\(visibility\("default"\)\)\)>
116119
)
117120
target_compile_options(pugixml-shared
118121
PRIVATE

0 commit comments

Comments
 (0)