From 7c9f56ff76bed9d33d577d78b9dc8060b3ac373a Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 3 Feb 2024 16:02:53 -0600 Subject: [PATCH] move out g++ O2 flag --- CMakeLists.txt | 4 ++-- CMakePresets.json | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b06162f9..fab064d1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,7 +52,7 @@ set(RECASTNAVIGATION_EXAMPLES OFF CACHE BOOL "" FORCE) # Disabled no-register # Disabled unknown pragmas because Linux doesn't understand Windows pragmas. if(UNIX) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -Wuninitialized -fPIC") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wuninitialized -fPIC") add_compile_definitions(_GLIBCXX_USE_CXX11_ABI=0 _GLIBCXX_USE_CXX17_ABI=0) if(NOT APPLE) @@ -67,7 +67,7 @@ if(UNIX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb") endif() - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -O2 -fPIC") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -fPIC") elseif(MSVC) # Skip warning for invalid conversion from size_t to uint32_t for all targets below for now set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") diff --git a/CMakePresets.json b/CMakePresets.json index f4b173af..433d77fa 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -17,7 +17,12 @@ "name": "ci-ubuntu-22.04", "displayName": "CI configure step for Ubuntu", "description": "Same as default, Used in GitHub actions workflow", - "inherits": "default" + "inherits": "default", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release", + "CMAKE_EXPORT_COMPILE_COMMANDS": "ON", + "CMAKE_CXX_FLAGS_INIT": "-O2" + } }, { "name": "ci-macos-13",