From 890ecc27cb1f6fa62763cede74e2b4c0c5ea01b3 Mon Sep 17 00:00:00 2001 From: eddiz <16883778+eddiz@users.noreply.github.com> Date: Sun, 19 Nov 2017 22:31:21 +0100 Subject: [PATCH] Optional Compiler Optimization Enable all Compile Optimization by setting according compiler flags. (Visual Studio tested, gcc and other should work properly, but untested) --- CMakeLists.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4e7e699..d25623c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -101,6 +101,17 @@ if (ENABLE_GOMA) set_compiler_launcher(ENABLE_GOMA gomacc) endif () +if(ENABLE_EXTRA_SPEED) + if(MSVC) + #enable parallel builds + add_compile_options("$<$:/Qpar>") + #maximum optimization in Release mode + add_compile_options("$<$,$>:/Ox>") + else() + add_compiler_flag_if_supported("-O3") + endif() +endif() + # Generate a version file containing repository info. include(FindGit) find_package(Git)