[libunwind] [CMake] Handle the RelWithDebInfo configuration similarly to Release
authorMartin Storsjö <martin@martin.st>
Wed, 4 May 2022 09:52:20 +0000 (12:52 +0300)
committerMartin Storsjö <martin@martin.st>
Wed, 4 May 2022 19:55:01 +0000 (22:55 +0300)
This makes sure to include libunwind log messages in the build if
LIBUNWIND_ENABLE_ASSERTIONS is set (which it is by default), when
building in RelWithDebInfo configurations.

Differential Revision: https://reviews.llvm.org/D124912

libunwind/CMakeLists.txt

index 6a76917..632316b 100644 (file)
@@ -295,11 +295,11 @@ if (LIBUNWIND_ENABLE_ASSERTIONS)
 
   # On Release builds cmake automatically defines NDEBUG, so we
   # explicitly undefine it:
-  if (uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE")
+  if (NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
     add_compile_flags(-UNDEBUG)
   endif()
 else()
-  if (NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE")
+  if (uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
     add_compile_flags(-DNDEBUG)
   endif()
 endif()