This makes the `_HAS_EXCEPTIONS` flag on windows only apply to libraries, and not if the library is used header only.
This commit is contained in:
committed by
GitHub
parent
35cda3d1fd
commit
f57e27de19
@@ -293,9 +293,7 @@ if(${Backtrace_FOUND})
|
|||||||
$<${ci_or_debug}:${Backtrace_INCLUDE_DIRS}>)
|
$<${ci_or_debug}:${Backtrace_INCLUDE_DIRS}>)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MSVC)
|
if(NOT MSVC)
|
||||||
target_compile_definitions(snmalloc INTERFACE -D_HAS_EXCEPTIONS=0)
|
|
||||||
else()
|
|
||||||
check_linker_flag(CXX "-rdynamic" SNMALLOC_LINKER_SUPPORT_RDYNAMIC)
|
check_linker_flag(CXX "-rdynamic" SNMALLOC_LINKER_SUPPORT_RDYNAMIC)
|
||||||
if (SNMALLOC_LINKER_SUPPORT_RDYNAMIC)
|
if (SNMALLOC_LINKER_SUPPORT_RDYNAMIC)
|
||||||
# Get better stack traces in CI and debug builds.
|
# Get better stack traces in CI and debug builds.
|
||||||
@@ -429,6 +427,10 @@ if(NOT SNMALLOC_HEADER_ONLY_LIBRARY)
|
|||||||
set_target_properties(${name} PROPERTIES CXX_VISIBILITY_PRESET hidden INTERPROCEDURAL_OPTIMIZATION ${SNMALLOC_COMPILER_SUPPORT_IPO})
|
set_target_properties(${name} PROPERTIES CXX_VISIBILITY_PRESET hidden INTERPROCEDURAL_OPTIMIZATION ${SNMALLOC_COMPILER_SUPPORT_IPO})
|
||||||
target_compile_definitions(${name} PRIVATE "SNMALLOC_USE_${SNMALLOC_CLEANUP}")
|
target_compile_definitions(${name} PRIVATE "SNMALLOC_USE_${SNMALLOC_CLEANUP}")
|
||||||
|
|
||||||
|
if(MSVC)
|
||||||
|
target_compile_definitions(${name} INTERFACE -D_HAS_EXCEPTIONS=0)
|
||||||
|
endif()
|
||||||
|
|
||||||
add_warning_flags(${name})
|
add_warning_flags(${name})
|
||||||
if(NOT MSVC)
|
if(NOT MSVC)
|
||||||
target_compile_definitions(${name} PRIVATE "SNMALLOC_EXPORT=__attribute__((visibility(\"default\")))")
|
target_compile_definitions(${name} PRIVATE "SNMALLOC_EXPORT=__attribute__((visibility(\"default\")))")
|
||||||
|
|||||||
Reference in New Issue
Block a user