In CMake, when declaring the include directories, consider adding the SYSTEM keyword.
This will make CMake create compile commands like this
/usr/bin/clang++ ... -isystem [...]/robin-hood-hashing/src/include -isystem /usr/local/include ...
instead of this
/usr/bin/clang++ -I[...]/robin-hood-hashing/src/include -isystem /usr/local/include
The effect is that the compiler is not supposed to issue warnings from these files, just like it doesn't for system libraries, hence the name. See also the CMake docs on this topic.
Background
This library has an awesome amount of warnings enabled. For the users of this library that means that they can usually also have a pretty high warning level enabled and treat warnings as errors. However, once in a while there is a warning generated in the robin_hood.h header. The most recent example was caused by a compiler update and also affected us. Of course, it is great that it was fixed so quickly. But still, if it didn't have effected us in the first place, that would have been even better. As a temporary solution I added the SYSTEM keyword to robin hood's CMakeLists.txt locally and it worked as expected.
Possible downsides
If users are not receiving any warnings anymore from your header, they won't report them either. If this is an issue, maybe SYSTEM could be enabled optionally by a CMake variable?
In CMake, when declaring the include directories, consider adding the
SYSTEMkeyword.This will make CMake create compile commands like this
instead of this
The effect is that the compiler is not supposed to issue warnings from these files, just like it doesn't for system libraries, hence the name. See also the CMake docs on this topic.
Background
This library has an awesome amount of warnings enabled. For the users of this library that means that they can usually also have a pretty high warning level enabled and treat warnings as errors. However, once in a while there is a warning generated in the
robin_hood.hheader. The most recent example was caused by a compiler update and also affected us. Of course, it is great that it was fixed so quickly. But still, if it didn't have effected us in the first place, that would have been even better. As a temporary solution I added theSYSTEMkeyword to robin hood'sCMakeLists.txtlocally and it worked as expected.Possible downsides
If users are not receiving any warnings anymore from your header, they won't report them either. If this is an issue, maybe
SYSTEMcould be enabled optionally by a CMake variable?