From debcb95709a8766eb66cfb6ac8dc720fd4acd3f5 Mon Sep 17 00:00:00 2001 From: "MA-DEVELOP\\apeltauer" Date: Wed, 10 Apr 2019 06:55:53 +0200 Subject: [PATCH] make the /mp compile flag optional --- CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 01754d8215..cafed217e9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1180,10 +1180,14 @@ IF(MSVC) IF(FREECAD_RELEASE_SEH) SET (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /EHa") ENDIF(FREECAD_RELEASE_SEH) + + OPTION(MP_COMPILE_FLAG "Add /MP flag to the compiler definitions. Speeds up the compile on multi processor machines" OFF) + if( MP_COMPILE_FLAG ) # set "Build with Multiple Processes" SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP") - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP") - + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP") + endif() + # Mark 32 bit executables large address aware so they can use > 2GB address space # NOTE: This setting only has an effect on machines with at least 3GB of RAM, although it sets the linker option it doesn't set the linker switch 'Enable Large Addresses' IF(CMAKE_SIZEOF_VOID_P EQUAL 4)