summaryrefslogtreecommitdiffstats
path: root/Modules/Platform/Windows-MSVC.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-06-26 13:38:35 (GMT)
committerBrad King <brad.king@kitware.com>2015-06-26 14:07:08 (GMT)
commit806609c7024dbf07a639a9d77074d4bc82ae1b8a (patch)
tree9722ec7e2129e407ff10794fb5c5035c0a6a9e2f /Modules/Platform/Windows-MSVC.cmake
parentdcc2a7ccd4f8d9612b224d7106a4c3cfcd48e6fc (diff)
downloadCMake-806609c7024dbf07a639a9d77074d4bc82ae1b8a.zip
CMake-806609c7024dbf07a639a9d77074d4bc82ae1b8a.tar.gz
CMake-806609c7024dbf07a639a9d77074d4bc82ae1b8a.tar.bz2
VS: Add /machine: flag to Librarian tool (#11240)
If a Windows resource (.rc) source file is included in a STATIC library, the VS "link" tool will process the compiled ".res" file and needs to know the target architecture. Without it, we may get a LNK4068 warning and possibly a LNK1112 error. Add /machine: to the default static library flags to give the link tool the information it needs.
Diffstat (limited to 'Modules/Platform/Windows-MSVC.cmake')
-rw-r--r--Modules/Platform/Windows-MSVC.cmake1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake
index 13fe8bc..2537e39 100644
--- a/Modules/Platform/Windows-MSVC.cmake
+++ b/Modules/Platform/Windows-MSVC.cmake
@@ -230,6 +230,7 @@ elseif(MSVC_Fortran_ARCHITECTURE_ID)
set(_MACHINE_ARCH_FLAG "/machine:${MSVC_Fortran_ARCHITECTURE_ID}")
endif()
set(CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} ${_MACHINE_ARCH_FLAG}")
+set(CMAKE_STATIC_LINKER_FLAGS_INIT "${CMAKE_STATIC_LINKER_FLAGS_INIT} ${_MACHINE_ARCH_FLAG}")
unset(_MACHINE_ARCH_FLAG)
# add /debug and /INCREMENTAL:YES to DEBUG and RELWITHDEBINFO also add pdbtype