CMake: Ignore paranoid MSVC linker warnings
authorSergey Sharybin <sergey.vfx@gmail.com>
Sat, 20 Feb 2016 07:45:29 +0000 (12:45 +0500)
committerSergey Sharybin <sergey.vfx@gmail.com>
Sat, 20 Feb 2016 09:06:09 +0000 (14:06 +0500)
CMakeLists.txt
source/blender/datatoc/CMakeLists.txt

index 3b388ccd5f8b47ab1c119a2d255bf5fab2102794..891539e0b34ca9cd7505254f4436b344226c8671 100644 (file)
@@ -1288,6 +1288,10 @@ elseif(WIN32)
 
                set(PLATFORM_LINKFLAGS "/SUBSYSTEM:CONSOLE /STACK:2097152 /INCREMENTAL:NO /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcmrt.lib /NODEFAULTLIB:msvcurt.lib /NODEFAULTLIB:msvcrtd.lib")
 
+               # Ignore meaningless for us linker warnings.
+               set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /ignore:4049 /ignore:4217 /ignore:4221")
+               set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /ignore:4221")
+
                # MSVC only, Mingw doesnt need
                if(CMAKE_CL_64)
                        set(PLATFORM_LINKFLAGS "/MACHINE:X64 /OPT:NOREF ${PLATFORM_LINKFLAGS}")
index 4c35a9417573467baadc22a8994c86024324ff5f..0f123fbf9f02351ff0f084bd73f32795834081cc 100644 (file)
@@ -51,6 +51,9 @@ if(NOT WITH_HEADLESS)
                        ../blenlib/intern/winstuff_dir.c
                        ../../../intern/utfconv/utfconv.c
                )
+
+               set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}")
+               set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}")
        endif()
 
        include_directories(${PNG_INCLUDE_DIRS})