mirror of
https://github.com/BlackMATov/meta.hpp.git
synced 2025-12-16 14:09:02 +07:00
NO_EXCEPTIONS, NO_RTTI dev presets
This commit is contained in:
5
develop/cmake/DisableExceptions.cmake
Normal file
5
develop/cmake/DisableExceptions.cmake
Normal file
@@ -0,0 +1,5 @@
|
||||
add_library(${PROJECT_NAME}.disable_exceptions INTERFACE)
|
||||
add_library(${PROJECT_NAME}::disable_exceptions ALIAS ${PROJECT_NAME}.disable_exceptions)
|
||||
|
||||
target_compile_options(${PROJECT_NAME}.disable_exceptions INTERFACE
|
||||
-fno-exceptions)
|
||||
5
develop/cmake/DisableRTTI.cmake
Normal file
5
develop/cmake/DisableRTTI.cmake
Normal file
@@ -0,0 +1,5 @@
|
||||
add_library(${PROJECT_NAME}.disable_rtti INTERFACE)
|
||||
add_library(${PROJECT_NAME}::disable_rtti ALIAS ${PROJECT_NAME}.disable_rtti)
|
||||
|
||||
target_compile_options(${PROJECT_NAME}.disable_rtti INTERFACE
|
||||
-fno-rtti)
|
||||
@@ -31,3 +31,16 @@ if(BUILD_WITH_SANITIZERS)
|
||||
meta.hpp::enable_asan
|
||||
meta.hpp::enable_ubsan)
|
||||
endif()
|
||||
|
||||
if(BUILD_WITH_NO_EXCEPTIONS)
|
||||
target_link_libraries(${PROJECT_NAME}.setup_targets INTERFACE
|
||||
meta.hpp::disable_exceptions)
|
||||
|
||||
target_compile_definitions(${PROJECT_NAME}.setup_targets INTERFACE
|
||||
DOCTEST_CONFIG_NO_EXCEPTIONS_BUT_WITH_ALL_ASSERTS)
|
||||
endif()
|
||||
|
||||
if(BUILD_WITH_NO_RTTI)
|
||||
target_link_libraries(${PROJECT_NAME}.setup_targets INTERFACE
|
||||
meta.hpp::disable_rtti)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user