From b819e27f55cdcf24be930b62b6ce7988467fb892 Mon Sep 17 00:00:00 2001 From: Arthur Bols Date: Fri, 23 Dec 2022 00:05:28 +0100 Subject: [PATCH] Add compiler optimizations for release builds --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index f7979ff..a5b9b2d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,6 +24,10 @@ else () add_compile_options(-Wall -Wextra -pedantic -Werror) endif () +if (CMAKE_BUILD_TYPE STREQUAL "Release") + add_compile_options(-O3 -march=native) +endif() + add_library(cplchess_lib OBJECT Square.cpp Move.cpp