build: cmake: add comment explaining CMAKE_CXX_FLAGS_RELWITHDEBINFO

to clarify why we need to set this flagset instead of appending to it.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>

Closes scylladb/scylladb#16546
This commit is contained in:
Kefu Chai
2023-12-25 15:35:48 +08:00
committed by Botond Dénes
parent 3ef0345b7f
commit 1f4b5126f6

View File

@@ -1,3 +1,8 @@
# it's important to *set* CMAKE_CXX_FLAGS_RELWITHDEBINFO here. otherwise,
# CMAKE_CXX_FLAGS_RELWITHDEBINFO would be initialized with
# CMAKE_CXX_FLAGS_RELWITHDEBUGINF_INIT, which is "-O2 -g -DNDEBUG",
# in CMake 3.27, but we need to enable "assert()" even with the release
# builds. so let's set this flagset instead of appending to it.
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO
"-ffunction-sections -fdata-sections"
CACHE