Skip to content

Commit

Permalink
Enable parallel builds for MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
darbyjohnston committed Oct 3, 2024
1 parent 6bb7126 commit c51a448
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ if(APPLE)
set(CMAKE_FIND_FRAMEWORK LAST)
endif()

if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
endif()

if(WIN32)
elseif(APPLE)
set(CMAKE_SKIP_BUILD_RPATH FALSE)
Expand Down
4 changes: 4 additions & 0 deletions etc/SuperBuild/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ endif()
if(APPLE)
set(CMAKE_FIND_FRAMEWORK LAST)
endif()
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
endif()

# https://stackoverflow.com/questions/45414507/pass-a-list-of-prefix-paths-to-externalproject-add-in-cmake-args
string(REPLACE ";" "|" CMAKE_MODULE_PATH_TMP "${CMAKE_MODULE_PATH}")
Expand Down

0 comments on commit c51a448

Please sign in to comment.