cmake: added -O2 which gives the performance improvement needed.

This commit is contained in:
suter_a 2018-06-05 07:59:24 +02:00
parent cd82c613aa
commit 57b7c52865

View File

@ -103,6 +103,11 @@ set_target_properties(PUserFcnBase
target_include_directories( target_include_directories(
PUserFcnBase BEFORE PRIVATE $<BUILD_INTERFACE:${MUSRFIT_INC}> PUserFcnBase BEFORE PRIVATE $<BUILD_INTERFACE:${MUSRFIT_INC}>
) )
#--- add compile options for optimization -------------------------------------
target_compile_options(PMusr PUBLIC -O2)
target_compile_options(PUserFcnBase PUBLIC -O2)
#--- add OpenMP compile options if needed ------------------------------------- #--- add OpenMP compile options if needed -------------------------------------
if (OpenMP_FOUND) if (OpenMP_FOUND)
target_compile_options(PMusr PUBLIC ${OpenMP_CXX_FLAGS}) target_compile_options(PMusr PUBLIC ${OpenMP_CXX_FLAGS})