The `-Wheader-hygiene` flag in COMPILER_FLAGS causes cmake errors building with g++ 9.3.0
The -Wheader-hygiene
flag does not appear to exist in g++ 9.3.0 and is part of the build flags at
https://gitlab.cern.ch/corryvreckan/corryvreckan/-/blob/master/CMakeLists.txt#L97
This causes the cmake
step to fail during CMake's compiler tests (see logfile)
As far as I can tell this is a clang-only diagnostic flag (?)
My CMakeError.log
:
Performing C++ SOURCE FILE Test CXX_FLAG_WORKS__Wheader_hygiene failed with the following output:
Change Dir: /home/roneil/2020octoberdesy/extern/corryvreckan/build/CMakeFiles/CMakeTmp
Run Build Command(s):/home/roneil/2020octoberdesy/.snakemake/conda/5ea0d0f4/bin/ninja cmTC_22edc && [1/2] Building CXX object CMakeFiles/cmTC_22edc.dir/src.cxx.o
FAILED: CMakeFiles/cmTC_22edc.dir/src.cxx.o
/home/roneil/2020octoberdesy/.snakemake/conda/5ea0d0f4/bin/g++ -DCXX_FLAG_WORKS__Wheader_hygiene -fvisibility-inlines-hidden -std=c++17 -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/roneil/2020octoberdesy/.snakemake/conda/5ea0d0f4/include -Wheader-hygiene -o CMakeFiles/cmTC_22edc.dir/src.cxx.o -c src.cxx
g++: error: unrecognized command line option '-Wheader-hygiene'
ninja: build stopped: subcommand failed.
Source file was:
int main() { return 0; }
Removing this flag seems to fix the problem