From ca8fbfe400931dbbd04a34f3c8567455808a03b5 Mon Sep 17 00:00:00 2001 From: Max Tropets Date: Fri, 17 Oct 2025 16:40:55 +0000 Subject: [PATCH 1/2] Remove interface linking for PRIVATE linkage --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index aea61c4af..194fa9aa9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -509,6 +509,10 @@ if(NOT SNMALLOC_HEADER_ONLY_LIBRARY) function(compile name TYPE ${ARGN}) add_library(${name} ${TYPE} ${ARGN}) target_link_libraries(${name} PRIVATE snmalloc) + + # PRIVATE linking still touches INTERFACE level linking for unknown reasons. + set_target_properties(${name} PROPERTIES INTERFACE_LINK_LIBRARIES "") + target_compile_definitions(${name} PRIVATE "SNMALLOC_USE_${SNMALLOC_CLEANUP}") add_warning_flags(${name}) From dcad0a904093f155929488d62e90d65964fa2d1c Mon Sep 17 00:00:00 2001 From: Max Tropets Date: Mon, 20 Oct 2025 09:10:15 +0000 Subject: [PATCH 2/2] Comment --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 194fa9aa9..cad25ef65 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -511,6 +511,7 @@ if(NOT SNMALLOC_HEADER_ONLY_LIBRARY) target_link_libraries(${name} PRIVATE snmalloc) # PRIVATE linking still touches INTERFACE level linking for unknown reasons. + # Check https://github.com/microsoft/snmalloc/pull/799 for details. set_target_properties(${name} PROPERTIES INTERFACE_LINK_LIBRARIES "") target_compile_definitions(${name} PRIVATE "SNMALLOC_USE_${SNMALLOC_CLEANUP}")