22# that configuring a build for a given platform is likely to build
33# out-of-the-box without customization. This does not mean that it is the only
44# 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.
57
68set (SwiftCore_ENABLE_BACKTRACING_default OFF ) # TODO: enable this by default
79set (SwiftCore_ENABLE_COMMANDLINE_SUPPORT_default OFF ) # TODO: enable this by default
@@ -10,13 +12,19 @@ set(SwiftCore_ENABLE_TYPE_PRINTING_default ON)
1012
1113set (SwiftCore_BACKTRACER_PATH_default "" )
1214
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`.
1318macro (defaulted_option variable helptext)
1419 if (NOT DEFINED ${variable} _default)
1520 set (${variable} _default OFF )
1621 endif ()
1722 option (${variable} ${helptext} ${${variable} _default})
1823endmacro ()
1924
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.
2028macro (defaulted_set variable type helptext)
2129 if (DEFINED ${variable} _default)
2230 set (${variable} ${variable} _default CACHE ${type} ${helptext} )
0 commit comments