cmake: Move /MP flag to MSVC compile flag section

This commit is contained in:
Florent Castelli 2017-01-25 06:08:19 +01:00
parent 221f991f1e
commit 2fd034789e

View File

@ -191,6 +191,11 @@ endif()
if(CMAKE_C_COMPILER_ID MATCHES "MSVC") if(CMAKE_C_COMPILER_ID MATCHES "MSVC")
check_and_add_flag(EXCEPTIONS /EHsc) check_and_add_flag(EXCEPTIONS /EHsc)
# Only MSBuild needs this, other generators will compile one file at a time
if(CMAKE_GENERATOR MATCHES "Visual Studio")
add_compile_options("/MP")
endif()
else() else()
add_definitions(-D_DEFAULT_SOURCE) add_definitions(-D_DEFAULT_SOURCE)
check_and_add_flag(HAVE_WALL -Wall) check_and_add_flag(HAVE_WALL -Wall)
@ -238,11 +243,6 @@ else()
endif() endif()
if(CMAKE_SYSTEM_NAME MATCHES "Windows") if(CMAKE_SYSTEM_NAME MATCHES "Windows")
# Only MSBuild needs this, other generators will compile one file at a time
if(CMAKE_GENERATOR MATCHES "Visual Studio")
add_compile_options("/MP")
endif()
add_definitions(-DNOMINMAX) add_definitions(-DNOMINMAX)
add_definitions(-DUNICODE) add_definitions(-DUNICODE)
add_definitions(-D_UNICODE) add_definitions(-D_UNICODE)