From 3e72ef63adff4ff0058be0ae1a2c77acd5817901 Mon Sep 17 00:00:00 2001 From: Nathaniel Wesley Filardo Date: Thu, 9 Jun 2022 02:11:10 +0100 Subject: [PATCH] NFC: cmake: add SNMALLOC_LINK_ICF, default on ICF currently breaks building on Morello, so allow cmake to notch it out. --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index da05a01..37fb8cc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,6 +18,7 @@ option(SNMALLOC_USE_CXX17 "Build as C++17 for legacy support." OFF) option(SNMALLOC_TRACING "Enable large quantities of debug output." OFF) option(SNMALLOC_NO_REALLOCARRAY "Build without reallocarray exported" ON) option(SNMALLOC_NO_REALLOCARR "Build without reallocarr exported" ON) +option(SNMALLOC_LINK_ICF "Link with Identical Code Folding" ON) # Options that apply only if we're not building the header-only library cmake_dependent_option(SNMALLOC_RUST_SUPPORT "Build static library for rust" OFF "NOT SNMALLOC_HEADER_ONLY_LIBRARY" OFF) cmake_dependent_option(SNMALLOC_STATIC_LIBRARY "Build static libraries" ON "NOT SNMALLOC_HEADER_ONLY_LIBRARY" OFF) @@ -318,7 +319,7 @@ if(NOT SNMALLOC_HEADER_ONLY_LIBRARY) endif() endif() # Remove all the duplicate new/malloc and free/delete definitions - target_link_options(${name} PRIVATE $<$:-Wl,--icf=all -fuse-ld=lld>) + target_link_options(${name} PRIVATE $<$:$<$:-Wl,--icf=all> -fuse-ld=lld>) endif() target_compile_definitions(${name} PRIVATE