CMake: Add missing XML_STATIC to test runners and fuzzers on Windows

This commit is contained in:
Sebastian Pipping 2022-04-16 13:49:15 +02:00
parent 6c7c40a6b7
commit 4b92533bbe
2 changed files with 23 additions and 6 deletions

View file

@ -455,12 +455,8 @@ target_include_directories(expat
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
if(WIN32)
if(EXPAT_SHARED_LIBS)
target_compile_definitions(expat PRIVATE VER_FILEVERSION=${_EXPAT_DLL_VERSION})
else()
target_compile_definitions(expat PUBLIC -DXML_STATIC)
endif()
if(WIN32 AND EXPAT_SHARED_LIBS)
target_compile_definitions(expat PRIVATE VER_FILEVERSION=${_EXPAT_DLL_VERSION})
endif()
expat_install(TARGETS expat EXPORT expat
@ -682,6 +678,23 @@ else()
endif()
endif()
#
# C/C++ config affecting multiple targets
#
if(WIN32)
set(_EXPAT_STATIC_TARGETS ${_EXPAT_TEST_TARGETS})
if(NOT EXPAT_SHARED_LIBS)
list(APPEND _EXPAT_STATIC_TARGETS expat)
endif()
if(EXPAT_BUILD_FUZZERS)
list(APPEND _EXPAT_STATIC_TARGETS fuzzpat)
endif()
foreach(_target ${_EXPAT_STATIC_TARGETS})
target_compile_definitions(${_target} PUBLIC -DXML_STATIC)
endforeach()
endif()
#
# Custom target "run-xmltest"
#

View file

@ -3,6 +3,10 @@ NOTE: We are looking for help with a few things:
If you can help, please get in touch. Thanks!
Release x.x.x xxx xxxxx xx xxxx
Other changes:
#597 #599 Windows|CMake: Add missing -DXML_STATIC to test runners
and fuzzers
Infrastructure:
#597 #598 CI: Windows: Start covering MSVC 2022