Skip to content

Commit

Permalink
Improve compilation speed on MS Windows (#269)
Browse files Browse the repository at this point in the history
* Add multiprocessing to MSbuild compile options

* Specify separate build folders for debug and release

* Update gitignore

---------

Co-authored-by: Jan Breuer <[email protected]>
  • Loading branch information
ronald-jaepel and jbreue16 authored Aug 13, 2024
1 parent 8072e29 commit a56a4a3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,10 @@ compile_commands.json

# Ignore build and install directories
build
build_RELEASE
build_RELEASE_with_Debug_Info
build_RELEASE_with_Tests
build_DEBUG
build_DEBUG_with_Tests
install
vcpkg_installed
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -463,13 +463,13 @@ if (CMAKE_BUILD_TYPE STREQUAL "Debug")
target_compile_options(CADET::CompileOptions INTERFACE $<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>>:
-Wall -pedantic-errors -Wextra -Wno-unused-parameter -Wno-unused-function> #-Wconversion -Wsign-conversion
$<$<CXX_COMPILER_ID:MSVC>:
/W4 /wd4100 /bigobj>
/W4 /wd4100 /bigobj /MP>
)
else()
target_compile_options(CADET::CompileOptions INTERFACE $<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>>:
-Wall -pedantic-errors -Wextra -Wno-unused-parameter -Wno-unused-function> #-Wconversion -Wsign-conversion
$<$<CXX_COMPILER_ID:MSVC>:
/W4 /wd4100>
/W4 /wd4100 /MP>
)
endif()

Expand Down
13 changes: 7 additions & 6 deletions CMakeSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"generator": "Visual Studio 17 2022 Win64",
"configurationType": "Debug",
"inheritEnvironments": [ "msvc_x64_x64" ],
"buildRoot": "${env.BUILDROOT}",
"buildRoot": "${env.BUILDROOT}_DEBUG",
"cmakeCommandArgs": "-DVCPKG_TARGET_TRIPLET=x64-windows-static -DENABLE_STATIC_LINK_LAPACK=ON -DENABLE_STATIC_LINK_DEPS=ON -DENABLE_TESTS=OFF -DENABLE_ANALYTIC_JACOBIAN_CHECK=OFF --fresh",
"buildCommandArgs": "-m -v:minimal",
"variables": [
Expand Down Expand Up @@ -43,12 +43,13 @@
"type": "STRING"
}
]
},{
},
{
"name": "DEBUG_with_Tests",
"generator": "Visual Studio 17 2022 Win64",
"configurationType": "Debug",
"inheritEnvironments": [ "msvc_x64_x64" ],
"buildRoot": "${env.BUILDROOT}",
"buildRoot": "${env.BUILDROOT}_DEBUG_with_Tests",
"cmakeCommandArgs": "-DVCPKG_TARGET_TRIPLET=x64-windows-static -DENABLE_STATIC_LINK_LAPACK=ON -DENABLE_STATIC_LINK_DEPS=ON -DENABLE_TESTS=ON -DENABLE_ANALYTIC_JACOBIAN_CHECK=OFF --fresh",
"buildCommandArgs": "-m -v:minimal",
"variables": [
Expand Down Expand Up @@ -84,7 +85,7 @@
"generator": "Visual Studio 17 2022 Win64",
"configurationType": "Release",
"inheritEnvironments": [ "msvc_x64_x64" ],
"buildRoot": "${env.BUILDROOT}",
"buildRoot": "${env.BUILDROOT}_RELEASE",
"cmakeCommandArgs": "-DVCPKG_TARGET_TRIPLET=x64-windows-static -DENABLE_STATIC_LINK_LAPACK=ON -DENABLE_STATIC_LINK_DEPS=ON -DENABLE_TESTS=OFF -DENABLE_ANALYTIC_JACOBIAN_CHECK=OFF --fresh",
"buildCommandArgs": "-m -v:minimal",
"variables": [
Expand Down Expand Up @@ -120,7 +121,7 @@
"generator": "Visual Studio 17 2022 Win64",
"configurationType": "RelWithDebInfo",
"inheritEnvironments": [ "msvc_x64_x64" ],
"buildRoot": "${env.BUILDROOT}",
"buildRoot": "${env.BUILDROOT}_RELEASE_with_Debug_Info",
"cmakeCommandArgs": "-DVCPKG_TARGET_TRIPLET=x64-windows-static -DENABLE_STATIC_LINK_LAPACK=ON -DENABLE_STATIC_LINK_DEPS=ON -DENABLE_TESTS=OFF -DENABLE_ANALYTIC_JACOBIAN_CHECK=OFF --fresh",
"buildCommandArgs": "-m -v:minimal",
"variables": [
Expand Down Expand Up @@ -156,7 +157,7 @@
"generator": "Visual Studio 17 2022 Win64",
"configurationType": "RelWithDebInfo",
"inheritEnvironments": [ "msvc_x64_x64" ],
"buildRoot": "${env.BUILDROOT}",
"buildRoot": "${env.BUILDROOT}_RELEASE_with_Tests",
"cmakeCommandArgs": "-DVCPKG_TARGET_TRIPLET=x64-windows-static -DENABLE_STATIC_LINK_LAPACK=ON -DENABLE_STATIC_LINK_DEPS=ON -DENABLE_TESTS=ON -DENABLE_ANALYTIC_JACOBIAN_CHECK=OFF --fresh",
"buildCommandArgs": "-m -v:minimal",
"variables": [
Expand Down

0 comments on commit a56a4a3

Please sign in to comment.