2
2
# that configuring a build for a given platform is likely to build
3
3
# out-of-the-box without customization. This does not mean that it is the only
4
4
# way that will work, or that it represents a shipping configuration.
5
+ # User-specified configurations should be done through cache files or by setting
6
+ # the variable with `-DSwiftCore_*` on the commandline.
5
7
6
8
set (SwiftCore_ENABLE_BACKTRACING_default OFF ) # TODO: enable this by default
7
9
set (SwiftCore_ENABLE_COMMANDLINE_SUPPORT_default OFF ) # TODO: enable this by default
@@ -10,13 +12,19 @@ set(SwiftCore_ENABLE_TYPE_PRINTING_default ON)
10
12
11
13
set (SwiftCore_BACKTRACER_PATH_default "" )
12
14
15
+ # Provide a boolean option that a user can optionally enable.
16
+ # Variables are defaulted based on the value of `<variable>_default`.
17
+ # If no such default variable exists, the option is defaults to `OFF`.
13
18
macro (defaulted_option variable helptext )
14
19
if (NOT DEFINED ${variable} _default )
15
20
set (${variable} _default OFF )
16
21
endif ()
17
22
option (${variable} ${helptext} ${${variable}_default} )
18
23
endmacro ()
19
24
25
+ # Create a defaulted cache entry
26
+ # Entries are defaulted on the value of `<variable>_default`.
27
+ # If no such default variable exists, the variable is not created.
20
28
macro (defaulted_set variable type helptext )
21
29
if (DEFINED ${variable} _default )
22
30
set (${variable} ${variable} _default CACHE ${type} ${helptext} )
0 commit comments