Skip to content

pedrolmcastro/cppmake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

CppMake

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

How to use it

  1. Copy the desired file to your project
  2. Include it in your CMakeLists.txt
  3. 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

References