From 10475f3432ea540d85ee8cd2ec04548280cd6cdd Mon Sep 17 00:00:00 2001 From: Nathaniel Filardo Date: Thu, 14 Nov 2019 15:40:05 +0000 Subject: [PATCH] Set linker-language C; prevents linking c++ stdlib Thanks to Alex Richardson for the suggestion --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 58b9345..7c54235 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -142,6 +142,10 @@ if(NOT DEFINED SNMALLOC_ONLY_HEADER_LIBRARY) if(EXPOSE_EXTERNAL_RESERVE) target_compile_definitions(${name} PRIVATE -DSNMALLOC_EXPOSE_RESERVE) endif() + + # Ensure that we do not link against C++ stdlib when compiling shims. + set_target_properties(${name} PROPERTIES LINKER_LANGUAGE C) + endmacro() if(NOT MSVC)