Skip to content

[lldb/cmake] Normalize use of HAVE_LIBCOMPRESSION #135528

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions lldb/include/lldb/Host/Config.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@

#cmakedefine01 HAVE_NR_PROCESS_VM_READV

#ifndef HAVE_LIBCOMPRESSION
#cmakedefine HAVE_LIBCOMPRESSION
#endif
#cmakedefine01 HAVE_LIBCOMPRESSION

#cmakedefine01 LLDB_ENABLE_POSIX

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
#define DEBUGSERVER_BASENAME "lldb-server"
#endif

#if defined(HAVE_LIBCOMPRESSION)
#if HAVE_LIBCOMPRESSION
#include <compression.h>
#endif

Expand Down Expand Up @@ -77,7 +77,7 @@ GDBRemoteCommunication::~GDBRemoteCommunication() {
Disconnect();
}

#if defined(HAVE_LIBCOMPRESSION)
#if HAVE_LIBCOMPRESSION
if (m_decompression_scratch)
free (m_decompression_scratch);
#endif
Expand Down Expand Up @@ -514,7 +514,7 @@ bool GDBRemoteCommunication::DecompressPacket() {
}
}

#if defined(HAVE_LIBCOMPRESSION)
#if HAVE_LIBCOMPRESSION
if (m_compression_type == CompressionType::ZlibDeflate ||
m_compression_type == CompressionType::LZFSE ||
m_compression_type == CompressionType::LZ4 ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ class GDBRemoteCommunication : public Communication {
HostThread m_listen_thread;
std::string m_listen_url;

#if defined(HAVE_LIBCOMPRESSION)
#if HAVE_LIBCOMPRESSION
CompressionType m_decompression_scratch_type = CompressionType::None;
void *m_decompression_scratch = nullptr;
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <compression.h>
#endif

Expand Down Expand Up @@ -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") {
Expand All @@ -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") {
Expand All @@ -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") {
Expand All @@ -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") {
Expand Down