Commit 927542f6 authored by Dominik Charousset's avatar Dominik Charousset

Add new CMake flag for disabling exceptions

parent 33b0914b
......@@ -15,6 +15,14 @@ if(WIN32 AND NOT CAF_BUILD_STATIC_ONLY)
set(CAF_BUILD_STATIC_ONLY yes)
endif()
################################################################################
# set included flags if needed #
################################################################################
if(CAF_FORCE_NO_EXCEPTIONS)
set(CAF_NO_EXCEPTIONS)
endif()
################################################################################
# set prefix paths if available #
################################################################################
......@@ -157,9 +165,17 @@ if(CAF_CXX_WARNINGS_AS_ERRORS)
endif()
# set compiler flags for GCOV if requested
if(CAF_ENABLE_GCOV)
set(NO_INLINE "-fno-inline -fno-inline-small-functions -fno-default-inline")
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
set(NO_INLINE "-fno-inline")
else()
set(NO_INLINE "-fno-inline -fno-inline-small-functions -fno-default-inline")
endif()
set(EXTRA_FLAGS "${EXTRA_FLAGS} -fprofile-arcs -ftest-coverage ${NO_INLINE}")
endif()
# set -fno-exception if requested
if(CAF_FORCE_NO_EXCEPTIONS)
set(EXTRA_FLAGS "${EXTRA_FLAGS} -fno-exceptions")
endif()
# enable a ton of warnings if --more-clang-warnings is used
if(CAF_MORE_WARNINGS)
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
......
......@@ -50,6 +50,7 @@ Usage: $0 [OPTION]... [VAR=VALUE]...
--no-compiler-check disable compiler version check
--no-auto-libc++ do not automatically enable libc++ for Clang
--no-exceptions build CAF without C++ exceptions
--force-no-exceptions build CAF with '-fno-exceptions'
--warnings-as-errors enables -Werror
Installation Directories:
......@@ -246,6 +247,10 @@ while [ $# -ne 0 ]; do
--no-exceptions)
append_cache_entry CAF_NO_EXCEPTIONS BOOL yes
;;
--force-no-exceptions)
append_cache_entry CAF_NO_EXCEPTIONS BOOL yes
append_cache_entry CAF_FORCE_NO_EXCEPTIONS BOOL yes
;;
--warnings-as-errors)
append_cache_entry CAF_CXX_WARNINGS_AS_ERRORS BOOL yes
;;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment