Developing C++ applications can be hard, but there are a lot of tools to make that task easier. Compiler warnings, hardening options, sanitizers, and static analyzers are some examples of that. At the same time, CMake became the go-to building tool for C++ projects, so this repository serves as a hub of CMake utilities for C++ development
- Copy the desired file to your project
- Include it in your
CMakeLists.txt
- Call the defined function with your target and desired options
Defines the cppmake_enable_warnings
function that adds warning options to the target's private compiler options
Argument | Description |
---|---|
TARGET <target> | Defines the target |
AS_ERRORS | Enables treating warnings as errors |
Defines the cppmake_sanitize
function that adds sanitizer options to the target's private compiler and link options
Argument | Description |
---|---|
TARGET <target> | Defines the target |
LEAK | Enables LeakSanitizer |
STACK | Enables SafeStack |
MEMORY | Enables MemorySanitizer |
THREAD | Enables ThreadSanitizer |
ADDRESS | Enables AddressSanitizer |
UNDEFINED | Enables UndefinedBehaviorSanitizer |
Note: At least one sanitizer must be specified in the arguments