statically link on MinGW

This commit is contained in:
CharlesThobe 2022-01-06 10:06:54 +02:00
parent bf0ef08b5b
commit 789e6559cf

View File

@ -72,3 +72,16 @@ target_link_libraries(chdman PRIVATE
userenv
)
endif()
if(MINGW)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
elseif(MSVC)
add_compile_definitions(
XML_STATIC
WIN32
_WIN32
_CRT_NONSTDC_NO_DEPRECATE
_CRT_SECURE_NO_DEPRECATE
_CRT_STDIO_LEGACY_WIDE_SPECIFIERS
)
endif()