From a8a2125069cedf2e5b3121b1d68051c36b09a1d5 Mon Sep 17 00:00:00 2001 From: Vojtech Kral Date: Mon, 8 Apr 2019 10:02:50 +0200 Subject: [PATCH] Windows deps & build doc: Fix msbuild parallelism, cf. #2078 --- deps/deps-windows.cmake | 16 ++++++++-------- doc/How to build - Windows.md | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/deps/deps-windows.cmake b/deps/deps-windows.cmake index a7397316f..0806c2388 100644 --- a/deps/deps-windows.cmake +++ b/deps/deps-windows.cmake @@ -62,7 +62,7 @@ ExternalProject_Add(dep_tbb -DTBB_BUILD_SHARED=OFF -DTBB_BUILD_TESTS=OFF "-DCMAKE_INSTALL_PREFIX:PATH=${DESTDIR}\\usr\\local" - BUILD_COMMAND msbuild /P:Configuration=Release INSTALL.vcxproj + BUILD_COMMAND msbuild /m /P:Configuration=Release INSTALL.vcxproj INSTALL_COMMAND "" ) if (${DEP_DEBUG}) @@ -70,7 +70,7 @@ if (${DEP_DEBUG}) ExternalProject_Add_Step(dep_tbb build_debug DEPENDEES build DEPENDERS install - COMMAND msbuild /P:Configuration=Debug INSTALL.vcxproj + COMMAND msbuild /m /P:Configuration=Debug INSTALL.vcxproj WORKING_DIRECTORY "${BINARY_DIR}" ) endif () @@ -86,7 +86,7 @@ ExternalProject_Add(dep_gtest -Dgtest_force_shared_crt=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON "-DCMAKE_INSTALL_PREFIX:PATH=${DESTDIR}\\usr\\local" - BUILD_COMMAND msbuild /P:Configuration=Release INSTALL.vcxproj + BUILD_COMMAND msbuild /m /P:Configuration=Release INSTALL.vcxproj INSTALL_COMMAND "" ) if (${DEP_DEBUG}) @@ -94,7 +94,7 @@ if (${DEP_DEBUG}) ExternalProject_Add_Step(dep_gtest build_debug DEPENDEES build DEPENDERS install - COMMAND msbuild /P:Configuration=Debug INSTALL.vcxproj + COMMAND msbuild /m /P:Configuration=Debug INSTALL.vcxproj WORKING_DIRECTORY "${BINARY_DIR}" ) endif () @@ -114,7 +114,7 @@ ExternalProject_Add(dep_nlopt -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_DEBUG_POSTFIX=d "-DCMAKE_INSTALL_PREFIX:PATH=${DESTDIR}\\usr\\local" - BUILD_COMMAND msbuild /P:Configuration=Release INSTALL.vcxproj + BUILD_COMMAND msbuild /m /P:Configuration=Release INSTALL.vcxproj INSTALL_COMMAND "" ) if (${DEP_DEBUG}) @@ -122,7 +122,7 @@ if (${DEP_DEBUG}) ExternalProject_Add_Step(dep_nlopt build_debug DEPENDEES build DEPENDERS install - COMMAND msbuild /P:Configuration=Debug INSTALL.vcxproj + COMMAND msbuild /m /P:Configuration=Debug INSTALL.vcxproj WORKING_DIRECTORY "${BINARY_DIR}" ) endif () @@ -138,7 +138,7 @@ ExternalProject_Add(dep_zlib "-DINSTALL_BIN_DIR=${CMAKE_CURRENT_BINARY_DIR}\\fallout" # I found no better way of preventing zlib from creating & installing DLLs :-/ -DCMAKE_POSITION_INDEPENDENT_CODE=ON "-DCMAKE_INSTALL_PREFIX:PATH=${DESTDIR}\\usr\\local" - BUILD_COMMAND msbuild /P:Configuration=Release INSTALL.vcxproj + BUILD_COMMAND msbuild /m /P:Configuration=Release INSTALL.vcxproj INSTALL_COMMAND "" ) if (${DEP_DEBUG}) @@ -146,7 +146,7 @@ if (${DEP_DEBUG}) ExternalProject_Add_Step(dep_zlib build_debug DEPENDEES build DEPENDERS install - COMMAND msbuild /P:Configuration=Debug INSTALL.vcxproj + COMMAND msbuild /m /P:Configuration=Debug INSTALL.vcxproj WORKING_DIRECTORY "${BINARY_DIR}" ) endif () diff --git a/doc/How to build - Windows.md b/doc/How to build - Windows.md index 8b750ce0d..e223239ba 100644 --- a/doc/How to build - Windows.md +++ b/doc/How to build - Windows.md @@ -66,7 +66,7 @@ There are several options for building from the command line: To build with msbuild, use the same CMake command as in previous paragraph and then build using - msbuild /P:Configuration=Release ALL_BUILD.vcxproj + msbuild /m /P:Configuration=Release ALL_BUILD.vcxproj To build with Ninja or nmake, replace the `-G` option in the CMake call with `-G Ninja` or `-G "NMake Makefiles"` , respectively. Then use either `ninja` or `nmake` to start the build. @@ -84,7 +84,7 @@ Then `cd` into the `deps` directory and use these commands to build: mkdir build cd build cmake .. -G "Visual Studio 12 Win64" -DDESTDIR="C:\local\destdir-custom" - msbuild ALL_BUILD.vcxproj + msbuild /m ALL_BUILD.vcxproj You can also use the Visual Studio GUI or other generators as mentioned above.