From a22ad659cd0665669d89fae174f9e6a83d1a446d Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Tue, 22 Apr 2025 10:14:03 +0200 Subject: [lldb/cmake] Normalize use of HAVE_LIBCOMPRESSION (#135528) I *think* this was the reason behind the failures in 2fd860c1f559c0b0be66cc000e38270a04d0a1a3: the clang include tool showed the Config.h headers as unused, and because the macro was referenced through an `#ifdef`, its removal didn't cause build failures. Switching to `#cmakedefine01` + `#if` should make sure this does not happen again. According to D48977, the `#ifndef`+`#cmakedefine` patterns is due to some files redefining the macro themselves. I no longer see any such files in the source tree (there also were no files like that in the source tree at the revision mentioned, but the macro *was* defined in the hand-maintained XCode project we had at the time). --- .../Process/gdb-remote/GDBRemoteCommunicationClient.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp') diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp index 501670d..748f95c 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -41,7 +41,7 @@ #include "llvm/Config/llvm-config.h" // for LLVM_ENABLE_ZLIB #include "llvm/Support/JSON.h" -#if defined(HAVE_LIBCOMPRESSION) +#if HAVE_LIBCOMPRESSION #include #endif @@ -1104,7 +1104,7 @@ void GDBRemoteCommunicationClient::MaybeEnableCompression( CompressionType avail_type = CompressionType::None; llvm::StringRef avail_name; -#if defined(HAVE_LIBCOMPRESSION) +#if HAVE_LIBCOMPRESSION if (avail_type == CompressionType::None) { for (auto compression : supported_compressions) { if (compression == "lzfse") { @@ -1114,9 +1114,6 @@ void GDBRemoteCommunicationClient::MaybeEnableCompression( } } } -#endif - -#if defined(HAVE_LIBCOMPRESSION) if (avail_type == CompressionType::None) { for (auto compression : supported_compressions) { if (compression == "zlib-deflate") { @@ -1140,7 +1137,7 @@ void GDBRemoteCommunicationClient::MaybeEnableCompression( } #endif -#if defined(HAVE_LIBCOMPRESSION) +#if HAVE_LIBCOMPRESSION if (avail_type == CompressionType::None) { for (auto compression : supported_compressions) { if (compression == "lz4") { @@ -1150,9 +1147,6 @@ void GDBRemoteCommunicationClient::MaybeEnableCompression( } } } -#endif - -#if defined(HAVE_LIBCOMPRESSION) if (avail_type == CompressionType::None) { for (auto compression : supported_compressions) { if (compression == "lzma") { -- cgit v1.1