Skip to content

Commit

Permalink
parallel compilation using 8 threads
Browse files Browse the repository at this point in the history
  • Loading branch information
LiangliangNan committed Jan 13, 2025
1 parent 84b9430 commit 6fec908
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,18 @@ project(${PROJECT_NAME})

################################################################################

set (CMAKE_CXX_STANDARD 11)
# specify the C++ standard
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
message(STATUS "Using C++11")

if(MSVC)
# The /MP flag is available and works as intended with the MSVC compiler
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
elseif(CMAKE_BUILD_PARALLEL_LEVEL)
# Use build system parallelism (e.g., `make -j` or `ninja`)
set(CMAKE_BUILD_PARALLEL_LEVEL 8) # Example: Use 8 threads
endif()

################################################################################

Expand Down

0 comments on commit 6fec908

Please sign in to comment.