From 208e9b4f60e92dcaf308b77cb026b0467f70d5d7 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Thu, 29 Aug 2019 01:59:14 +0200 Subject: [PATCH] CMake: Re-introduce MT/MD postfix for static windows .lib files --- expat/CMakeLists.txt | 10 +++++++++- expat/Changes | 2 +- expat/win32/build_expat_iss.bat | 4 ++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/expat/CMakeLists.txt b/expat/CMakeLists.txt index a91679e1..e7c7b28c 100644 --- a/expat/CMakeLists.txt +++ b/expat/CMakeLists.txt @@ -187,6 +187,14 @@ if(WIN32) set(_POSTFIX_WIDE "w") endif() + if(NOT BUILD_shared) + if(MSVC_USE_STATIC_CRT) + set(_POSTFIX_CRT "MT") + else() + set(_POSTFIX_CRT "MD") + endif() + endif() + foreach(postfix_var CMAKE_DEBUG_POSTFIX CMAKE_RELEASE_POSTFIX @@ -199,7 +207,7 @@ if(WIN32) set(_POSTFIX_DEBUG "") endif() - set(${postfix_var} "${_POSTFIX_WIDE}${_POSTFIX_DEBUG}" CACHE STRING "Windows binary postfix, e.g. expat.dll") + set(${postfix_var} "${_POSTFIX_WIDE}${_POSTFIX_DEBUG}${_POSTFIX_CRT}" CACHE STRING "Windows binary postfix, e.g. expat.lib") endforeach() endif(WIN32) diff --git a/expat/Changes b/expat/Changes index 74b4806e..1a9eaf68 100644 --- a/expat/Changes +++ b/expat/Changes @@ -27,7 +27,7 @@ Release x.x.x xxx xxx xx xxxx #265 CMake: Fix linking with MinGW #316 CMake: Windows: Make binary postfix match MSVC Old: expat[d].lib - New: expat[w][d].lib + New: expat[w][d][MD|MT].lib CMake: Migrate files from Windows to Unix line endings #299 #302 Windows: Replace LoadLibrary hack to access unofficial API function SystemFunction036 (RtlGenRandom) diff --git a/expat/win32/build_expat_iss.bat b/expat/win32/build_expat_iss.bat index 93f8fa45..80304576 100644 --- a/expat/win32/build_expat_iss.bat +++ b/expat/win32/build_expat_iss.bat @@ -57,7 +57,7 @@ CD build_static_char || EXIT /b 1 msbuild /m expat.sln || EXIT /b 1 DIR %CONFIGURATION% || EXIT /b 1 CD .. || EXIT /b 1 -COPY build_static_char\%CONFIGURATION%\expat.lib %BINDIR%\expatMT.lib || EXIT /b 1 +COPY build_static_char\%CONFIGURATION%\expatMT.lib %BINDIR%\ || EXIT /b 1 COPY build_static_char\xmlwf\%CONFIGURATION%\xmlwf.exe %BINDIR%\ || EXIT /b 1 @@ -77,7 +77,7 @@ CD build_static_wchar_t || EXIT /b 1 msbuild /m expat.sln || EXIT /b 1 DIR %CONFIGURATION% || EXIT /b 1 CD .. || EXIT /b 1 -COPY build_static_wchar_t\%CONFIGURATION%\expatw.lib %BINDIR%\expatwMT.lib || EXIT /b 1 +COPY build_static_wchar_t\%CONFIGURATION%\expatwMT.lib %BINDIR%\ || EXIT /b 1 DIR %BINDIR% || EXIT /b 1 -- 2.40.0