Skip to content

Commit fdc1e35

Browse files
re-add _DEBUG for Debug builds, and print undefines in verbose mode
1 parent 32b592a commit fdc1e35

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

libc/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ endif()
77
include(${LLVM_COMMON_CMAKE_UTILS}/Modules/CMakePolicy.cmake
88
NO_POLICY_SCOPE)
99

10+
if (LIBC_CMAKE_VERBOSE_LOGGING)
11+
get_directory_property(LIBC_OLD_PREPROCESSOR_DEFS COMPILE_DEFINITIONS)
12+
foreach(OLD_DEF ${LIBC_OLD_PREPROCESSOR_DEFS})
13+
message(STATUS "Undefining ${OLD_DEF}")
14+
endforeach()
15+
endif()
1016
set_directory_properties(PROPERTIES
1117
# `llvm-project/llvm/CMakeLists.txt` adds the following directive
1218
# `include_directories( ${LLVM_INCLUDE_DIR} ${LLVM_MAIN_INCLUDE_DIR})` We
@@ -16,6 +22,9 @@ set_directory_properties(PROPERTIES
1622
# to set a few preprocessor defines which we do not want.
1723
COMPILE_DEFINITIONS ""
1824
)
25+
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
26+
add_definitions("-D_DEBUG")
27+
endif()
1928

2029
# Default to C++17
2130
set(CMAKE_CXX_STANDARD 17)

0 commit comments

Comments
 (0)