From ee2c6cc7c2bec8982a532bff1299f9cee4f942de Mon Sep 17 00:00:00 2001 From: Nadia Holmquist Pedersen Date: Sun, 5 May 2024 08:14:00 +0200 Subject: [PATCH] actually add the cmake script too --- cmake/DefaultBuildFlags.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 cmake/DefaultBuildFlags.cmake diff --git a/cmake/DefaultBuildFlags.cmake b/cmake/DefaultBuildFlags.cmake new file mode 100644 index 00000000..683767b3 --- /dev/null +++ b/cmake/DefaultBuildFlags.cmake @@ -0,0 +1,9 @@ +if (CMAKE_C_COMPILER_ID STREQUAL GNU) + set(CMAKE_C_FLAGS_DEBUG_INIT "-g -Og") +endif() +if (CMAKE_CXX_COMPILER_ID STREQUAL GNU) + set(CMAKE_CXX_FLAGS_DEBUG_INIT "-g -Og") +endif() + +string(REPLACE "-O2" "-O3" CMAKE_C_FLAGS_RELEASE_INIT "${CMAKE_C_FLAGS_RELEASE_INIT}") +string(REPLACE "-O2" "-O3" CMAKE_CXX_FLAGS_RELEASE_INIT "${CMAKE_CXX_FLAGS_RELEASE_INIT}")