Skip to content

Commit

Permalink
Build: compile source files in parallel under MSVC
Browse files Browse the repository at this point in the history
When using cmake with Visual Studio project files (default on Windows), add MSVC compile flag that enables using more than 1 CPU core during the build (i.e. compile source files in parallel).
  • Loading branch information
aras-p authored Nov 17, 2024
1 parent 05de3bf commit 7215dd4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ if(CMAKE_COMPILER_IS_GNUCC)
set(OPENJPEG_LIBRARY_COMPILE_OPTIONS ${OPENJPEG_LIBRARY_COMPILE_OPTIONS} "$<$<CONFIG:Release>:-ffast-math>")
set(OPENJP2_COMPILE_OPTIONS ${OPENJP2_COMPILE_OPTIONS} "$<$<CONFIG:Release>:-ffast-math>" -Wall -Wextra -Wconversion -Wunused-parameter -Wdeclaration-after-statement -Werror=declaration-after-statement -Wstrict-prototypes -Werror=strict-prototypes -Wmissing-prototypes -Werror=missing-prototypes)
endif()
if(MSVC)
# Parallel source file compilation in MSVC
set(OPENJP2_COMPILE_OPTIONS ${OPENJP2_COMPILE_OPTIONS} "/MP")
endif()

#-----------------------------------------------------------------------------
# opj_config.h generation (1/2)
Expand Down

0 comments on commit 7215dd4

Please sign in to comment.