File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,12 @@ option(lager_BUILD_DEBUGGER_EXAMPLES "Build examples that showcase the web based
28
28
option (lager_BUILD_DOCS "Build docs" ON )
29
29
option (lager_EMBED_RESOURCES_PATH "Embed installation paths for easier, non-portable resource location" ON )
30
30
option (lager_DISABLE_STORE_DEPENDENCY_CHECKS "Disable compile-time checks for store dependencies" OFF )
31
+ option (lager_ENABLE_EXCEPTIONS "Always enable exceptions regardless of detected compiler support" OFF )
32
+ option (lager_DISABLE_EXCEPTIONS "Always disable exceptions regardless of detected compiler support" OFF )
33
+
34
+ if (lager_ENABLE_EXCEPTIONS AND lager_DISABLE_EXCEPTIONS )
35
+ message (FATAL_ERROR "Cannot both enable and disable exceptions" )
36
+ endif ()
31
37
32
38
if (NOT lager_EMBED_RESOURCES_PATH AND lager_BUILD_EXAMPLES )
33
39
message (FATAL_ERROR "Examples require embedded resources path" )
@@ -67,6 +73,16 @@ if(lager_DISABLE_STORE_DEPENDENCY_CHECKS)
67
73
target_compile_definitions (lager INTERFACE LAGER_DISABLE_STORE_DEPENDENCY_CHECKS )
68
74
endif ()
69
75
76
+ if (lager_ENABLE_EXCEPTIONS )
77
+ message (STATUS "Explicitly enabling exceptions" )
78
+ target_compile_definitions (lager INTERFACE LAGER_USE_EXCEPTIONS )
79
+ endif ()
80
+
81
+ if (lager_DISABLE_EXCEPTIONS )
82
+ message (STATUS "Explicitly disabling exceptions" )
83
+ target_compile_definitions (lager INTERFACE LAGER_NO_EXCEPTIONS )
84
+ endif ()
85
+
70
86
install (TARGETS lager EXPORT LagerConfig )
71
87
72
88
# requirements for tests and examples
Original file line number Diff line number Diff line change 20
20
#define LAGER_DISABLE_STORE_DEPENDENCY_CHECKS
21
21
#endif
22
22
23
+ #if !defined(LAGER_USE_EXCEPTIONS) && !defined(LAGER_NO_EXCEPTIONS)
23
24
#ifdef __has_feature
24
25
#if !__has_feature(cxx_exceptions)
25
26
#define LAGER_NO_EXCEPTIONS
26
27
#endif
27
28
#endif
29
+ #endif
28
30
29
31
#ifdef LAGER_NO_EXCEPTIONS
30
32
#define LAGER_TRY if (true )
You can’t perform that action at this time.
0 commit comments