Catch2 icon indicating copy to clipboard operation
Catch2 copied to clipboard

When used as subproject, treat Catch2 cmake target include paths as SYSTEM

Open ashaduri opened this issue 5 years ago • 2 comments

… to avoid compiler warnings in Catch2 headers.

Description

When embedding Catch2 into a cmake project using add_subdirectory(), Catch2 target include paths are simply PUBLIC. If a user project has many compiler warnings enabled, they may get triggered simply by including Catch2 headers.

This PR marks the Catch2 include paths as SYSTEM when it's used as a subproject, so that these include paths are treated as system header locations. This makes the compilers avoid user-enabled warnings from Catch2 headers.

ashaduri avatar Mar 17 '21 11:03 ashaduri

Codecov Report

Merging #2190 (92d827c) into devel (037ddbc) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##            devel    #2190   +/-   ##
=======================================
  Coverage   90.07%   90.07%           
=======================================
  Files         146      146           
  Lines        7110     7110           
=======================================
  Hits         6404     6404           
  Misses        706      706           

codecov[bot] avatar Mar 17 '21 12:03 codecov[bot]

https://github.com/ChrisThrasher/argon/blob/master/tests/FindCatch2.cmake#L10

This can be fixed from your project as well if you'd like. Take the Catch2 target's interface include directories and re-apply them with SYSTEM.

ChrisThrasher avatar Mar 03 '23 22:03 ChrisThrasher