diff --git a/CMakeLists.txt b/CMakeLists.txt index 5d4a2fa..35b5fcb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,12 @@ project(nutri) set(CMAKE_CXX_STANDARD 26) set(CMAKE_EXPORT_COMPILE_COMMANDS 1) -set(CMAKE_CXX_FLAGS -fdiagnostics-color=always) +add_compile_options(-fdiagnostics-color=always) + +if(CMAKE_BUILD_TYPE STREQUAL "Release") + set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) + add_compile_options(-O3 -march=native) +endif() include(FetchContent) diff --git a/README.md b/README.md index 492ff95..f9d1a36 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ cd nutri ### Build with CMake ```bash -cmake -S . -B build +cmake -B build -DCMAKE_BUILD_TYPE=Release cmake --build build ```