diff --git a/CMakeLists.txt b/CMakeLists.txt index aea61c4af..cad25ef65 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -509,6 +509,11 @@ 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. + # 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}") add_warning_flags(${name})