You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`ENABLE_INCLUDE_WHAT_YOU_USE`: Enable static analysis with include-what-you-use
94
+
-`ENABLE_USER_LINKER`: Enable a specific linker if available
95
+
-`ENABLE_BUILD_WITH_TIME_TRACE`: Enable `-ftime-trace` to generate time tracing `.json` files on clang
96
+
-`ENABLE_UNITY`: Enable Unity builds of projects
95
97
96
-
It gets the following named parameters (each accepting multiple values):
98
+
It gets the following named parameters that can have different values in front of them:
97
99
100
+
-`DOXYGEN_THEME`: the name of the Doxygen theme to use. Supported themes: `awesome-sidebar` (default), `awesome` and `original`.
98
101
-`PCH_HEADERS`: the list of the headers to precompile
99
102
-`MSVC_WARNINGS`: Override the defaults for the MSVC warnings
100
103
-`CLANG_WARNINGS`: Override the defaults for the CLANG warnings
@@ -113,7 +116,7 @@ Named String:
113
116
-`VCPKG_DIR`: (Defaults to `~/vcpkg`). You can provide the vcpkg installation directory using this optional parameter.
114
117
If the directory does not exist, it will automatically install vcpkg in this directory.
115
118
116
-
-`VCPKG_URL`: (Defaults to `https://github.com/microsoft/vcpkg.git`). This option allows setting URL of the vcpkg repository. By default, the official vcpkg repository is used.
119
+
-`VCPKG_URL`: (Defaults to `https://github.com/microsoft/vcpkg.git`). This option allows setting the URL of the vcpkg repository. By default, the official vcpkg repository is used.
## Changing the project_options parameters dynamically
140
+
## Changing the project_options dynamically
141
+
142
+
During the test and development, it can be useful to change options on the fly. For example, to enable sanitizers when running tests. You can include `DynamicOptions.cmake`, which imports the `dynamic_project_options` function.
143
+
144
+
`dynamic_project_options` provides a recommended set of defaults (all static analysis and runtime analysis enabled for platforms where that is possible) while also providing a high-level option `ENABLE_DEVELOPER_MODE` (defaulted to `ON`) which can be turned off for easy use by non-developers.
138
145
139
-
It might be useful to change the test and development options on the fly (e.g., to enable sanitizers when running tests). To do this, you can include the `GlobalOptions.cmake`, which adds global options for the arguments of `project_options` function.
146
+
The goal of the `dynamic_project_options` is to give a safe and well-analyzed environment to the developer by default while simultaneously making it easy for a user of the project to compile while not having to worry about clang-tidy, sanitizers, cppcheck, etc.
140
147
141
-
⚠️ It is highly recommended to keep the build declarative and reproducible by using the function arguments as explained above. The user of your code should not need to pass any special flags to build the library for normal usage. Please do not use this for anything other than test and development.
148
+
The defaults presented to the user can be modified with
149
+
150
+
-`set(<featurename>_DEFAULT value)` - for user and developer builds
151
+
-`set(<featurename>_USER_DEFAULT value)` - for user builds
152
+
-`set(<featureoptionname>_DEVELOPER_DEFAULT value)` - for developer builds
153
+
154
+
If you need to fix a setting for the sake of a command-line configuration, you can use:
0 commit comments