Skip to content

Commit feea1ad

Browse files
committed
Add mini guide on how to customise a preset
1 parent af29609 commit feea1ad

File tree

1 file changed

+14
-1
lines changed
  • docs/+current/modules/compiler

1 file changed

+14
-1
lines changed

docs/+current/modules/compiler/gcc.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,17 @@ include("rsp/compiler")
2323
add_compile_options(${RSP_GCC_STRICT_COMPILE_OPTIONS})
2424
```
2525

26-
For additional information, please review the `RSP_GCC_STRICT_COMPILE_OPTIONS` list, in the source code.
26+
For additional information, please review the `RSP_GCC_STRICT_COMPILE_OPTIONS` list, in the source code.
27+
28+
### Customize
29+
30+
If you need to customise a preset, create a copy of the desired preset, and use cmake's
31+
[list](https://cmake.org/cmake/help/latest/command/list.html#list) operations to remove or append options.
32+
33+
```cmake
34+
# Copy provided preset into new variable
35+
set(my_compile_options "${RSP_GCC_STRICT_COMPILE_OPTIONS}")
36+
37+
# Modify your preset...
38+
list(REMOVE_ITEM my_compile_options "-Wswitch-default")
39+
```

0 commit comments

Comments
 (0)