I am building a project that includes llvm. I want to enable warnings for my code, but ignore warnings from code in llvm headers.
I have a source file like:
// main.cpp
#include <llvm/IR/Instructions.h>
void foo() {
// blah blah blah
}
and a CMake file like:
add_executable(prog main.cpp)
target_link_libraries(prog ${llvm_libs})
target_compile_options(prog PRIVATE "-Weverything")
But the -Weverything produces a huge number of warnings in the included llvm files, when I only care about seeing warnings in my own code.
How can I enable warnings for my code, without also seeing warnings for the included llvm headers?