[Bf-blender-cvs] [200695dd890] master: Windows: Clean-up linker warnings regarding MSVCRT.lib

Ray Molenkamp noreply at git.blender.org
Wed Mar 11 17:33:19 CET 2020


Commit: 200695dd890caa5771043c2454a6731918023cad
Author: Ray Molenkamp
Date:   Wed Mar 11 10:33:12 2020 -0600
Branches: master
https://developer.blender.org/rB200695dd890caa5771043c2454a6731918023cad

Windows: Clean-up linker warnings regarding MSVCRT.lib

For debug builds we link the against the release mode libs
for C based libraries, which are technically linked against
a different CRT, which the linker will implicitly try to link.

Which results in a linker warning about mixing the debug/release CRT.

This patch prevents the implicit linking of the release
CRT in debug configurations for sub projects that had issues
with it.

===================================================================

M	source/blender/blendthumb/CMakeLists.txt
M	source/blender/blentranslation/msgfmt/CMakeLists.txt

===================================================================

diff --git a/source/blender/blendthumb/CMakeLists.txt b/source/blender/blendthumb/CMakeLists.txt
index 6c786dfcc7a..0b1ce5149da 100644
--- a/source/blender/blendthumb/CMakeLists.txt
+++ b/source/blender/blendthumb/CMakeLists.txt
@@ -28,6 +28,8 @@ set(SRC
   src/Dll.cpp
 )
 
+set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} /nodefaultlib:MSVCRT.lib")
+
 add_library(BlendThumb SHARED ${SRC})
 target_link_libraries(BlendThumb ${ZLIB_LIBRARIES})
 
diff --git a/source/blender/blentranslation/msgfmt/CMakeLists.txt b/source/blender/blentranslation/msgfmt/CMakeLists.txt
index 147c375aa6e..350473fa195 100644
--- a/source/blender/blentranslation/msgfmt/CMakeLists.txt
+++ b/source/blender/blentranslation/msgfmt/CMakeLists.txt
@@ -37,6 +37,10 @@ if(APPLE)
   set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}")
 endif()
 
+if(WIN32)
+  set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /nodefaultlib:MSVCRT.lib")
+endif()
+
 add_executable(msgfmt ${SRC})
 
 target_link_libraries(msgfmt bf_blenlib)



More information about the Bf-blender-cvs mailing list