Skip to content

max-and-me/warn-cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Warn CPP

Introduction

This library contains a CMake function and a C++ header to better deal with wanings in your projects.

Getting Started

Include into your project

You can include the library by simple using FetchContent as follows:

...
FetchContent_Declare(
    warn-cpp
    GIT_REPOSITORY "https://github.com/max-and-me/warn-cpp.git"
    GIT_TAG main
)

FetchContent_MakeAvailable(warn-cpp)
...

Afterwards you can apply the warnings to any of your targets:

...
target_link_libraries(MyTarget
    PRIVATE
        warn-cpp
)

mam_target_compile_warnings(MyTarget)
...

Pass multiple targets like this: mam_target_compile_warnings(MyTarget MyLib1 MyLib2)

Suppress warnings

Whenever an external library causes warnings by including one of its headers you can simply disable them:

#include "my_header.h"
#include "warn_cpp/suppress_warnings.h"
BEGIN_SUPPRESS_WARNINGS
#include "extern/lib1/header.h"
#include "extern/lib2/header.h"
#include "extern/lib3/header.h"
END_SUPPRESS_WARNINGS

Getting Help

Further links

Releases

No releases published

Packages

No packages published