]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
build: PREPEND -Og, not APPEND 44831/head
authorAdam C. Emerson <aemerson@redhat.com>
Fri, 28 Jan 2022 21:14:43 +0000 (16:14 -0500)
committerAdam C. Emerson <aemerson@redhat.com>
Mon, 14 Feb 2022 18:51:05 +0000 (13:51 -0500)
This modifies 8e742424a7f9f5204bee435ca8609e93f648ef77 so we will
still use -Og by default

But passing -DCMAKE_CXX_FLAGS_DEBUG='-O0' will allow one to still get
a -O0 build.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/CMakeLists.txt

index 1157df00a1995d7ffb1fdd31db5696b5890050fd..165dbe07ef9f5d547c38397e945c40c15da9249d 100644 (file)
@@ -121,7 +121,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
   else()
     string(APPEND CMAKE_EXE_LINKER_FLAGS " -rdynamic")
   endif()
-  string(APPEND CMAKE_CXX_FLAGS_DEBUG " -Og")
+  string(PREPEND CMAKE_CXX_FLAGS_DEBUG "-Og ")
   add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wstrict-null-sentinel>)
   add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Woverloaded-virtual>)
   add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-fno-new-ttp-matching>)
@@ -135,7 +135,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
 elseif(CMAKE_CXX_COMPILER_ID STREQUAL Clang)
   set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_EXPORTS_C_FLAG}")
   string(APPEND CMAKE_LINKER_FLAGS " -rdynamic -export-dynamic ${CMAKE_EXE_EXPORTS_C_FLAG}")
-  string(APPEND CMAKE_CXX_FLAGS_DEBUG " -g")
+  string(PREPEND CMAKE_CXX_FLAGS_DEBUG "-g ")
   add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wno-inconsistent-missing-override>)
   add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wno-mismatched-tags>)
   add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wno-unused-private-field>)