On 2017-08-21 15:47, Cantor, Scott wrote:
What type of change is your colleague proposing to turn it on?
He was proposing something like this:
if(WIN32)
set(CMAKE_CXX_FLAGS "\MP")
endif()
But neither of us know cmake, he's just trying to make it work the way
the original builds did.
I think this is too general. WIN32 is set for all builds on Windows
platforms, so would break GCC or clang builds. MSVC is set when using
cl, but for all generators so would break with Ninja or nmake etc.
I think you probably want this:
if(CMAKE_GENERATOR MATCHES "Visual Studio")
string(APPEND CMAKE_CXX_FLAGS "\\MP")
endif()
so that it's specific to MSVC with the msbuild project/solution file
generator for Visual Studio. And it also appends to the flags already
set so it won't wipe them out. You can equally set CXXFLAGS when
running cmake for the same effect, i.e. cmake -G "Visual Studio..."
-DCMAKE_CXX_FLAGS=\MP ...
Regards,
Roger
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]