From d76ac2a254cc331981387867ccf73090a8f86e2b Mon Sep 17 00:00:00 2001 From: Andrew Noyes Date: Wed, 24 Jan 2024 15:18:00 -0800 Subject: [PATCH] Try exported symbols list for Apple visibility annotations seem to be working for gcc --- CMakeLists.txt | 8 +++++--- ConflictSet.cpp | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d87e62a..73a4747 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,10 +61,12 @@ add_custom_command( ${CMAKE_OBJCOPY} --keep-global-symbols=${CMAKE_SOURCE_DIR}/symbols.txt $) -if(NOT APPLE) +if(APPLE) target_link_options( - ${PROJECT_NAME} PRIVATE - "LINKER:-export-symbols=${CMAKE_CURRENT_SOURCE_DIR}/linker.map") + ${PROJECT_NAME} + PRIVATE + "LINKER:-no_weak_exports,-exported_symbols_list,${CMAKE_SOURCE_DIR}/symbols.txt" + ) endif() set(TEST_FLAGS -Wall -Wextra -Wpedantic -Wunreachable-code -UNDEBUG) diff --git a/ConflictSet.cpp b/ConflictSet.cpp index 36278cd..3eacfe1 100644 --- a/ConflictSet.cpp +++ b/ConflictSet.cpp @@ -1305,7 +1305,7 @@ void printLogical(std::string &result, Node *node) { } } -void debugPrintDot(FILE *file, Node *node) { +[[maybe_unused]] void debugPrintDot(FILE *file, Node *node) { struct DebugDotPrinter { @@ -1353,7 +1353,7 @@ void checkParentPointers(Node *node, bool &success) { } } -int64_t checkMaxVersion(Node *node, bool &success) { +[[maybe_unused]] int64_t checkMaxVersion(Node *node, bool &success) { int64_t expected = node->entryPresent ? std::max(node->entry.pointVersion, node->entry.rangeVersion)