Small change to CMake options to only enable the PreferredToolArchitecture=x64 option (required for 32bit TeamCity builds) on 32 bit builds generally - removes a ton of 'unknown option, ignored' spam in the build output

master
Callum Prentice 2020-07-29 13:52:24 -07:00 committed by Dave Houlton
parent 61c95231f1
commit 64a78b8c7f
1 changed files with 6 additions and 1 deletions

View File

@ -63,7 +63,12 @@ if (WINDOWS)
# Without PreferredToolArchitecture=x64, as of 2020-06-26 the 32-bit
# compiler on our TeamCity build hosts has started running out of virtual
# memory for the precompiled header file.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP /p:PreferredToolArchitecture=x64")
# CP changed to only append the flag for 32bit builds - on 64bit builds,
# locally at least, the build output is spammed with 1000s of 'D9002'
# warnings about this switch being ignored.
if( ADDRESS_SIZE EQUAL 32 )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP /p:PreferredToolArchitecture=x64")
endif()
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO
"${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Zo"