From bb3231695f00f3f73889b7ef10a78239c1af90e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vebj=C3=B8rn=20Johansen=20Rognli?= Date: Sat, 11 Jun 2022 18:39:07 +0200 Subject: [PATCH] Set includes as system interface to suppress warnings for other users (#415) Set includes as system interface to suppress warnings for other users Co-authored-by: ArthurSonzogni --- cmake/ftxui_set_options.cmake | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/cmake/ftxui_set_options.cmake b/cmake/ftxui_set_options.cmake index 7017639..1cefd5c 100644 --- a/cmake/ftxui_set_options.cmake +++ b/cmake/ftxui_set_options.cmake @@ -13,14 +13,31 @@ function(ftxui_set_options library) set_target_properties(${library} PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_EXE};-warnings-as-errors=*" ) + + # By using "PUBLIC" as opposed to "SYSTEM INTERFACE", the compiler warning + # are enforced on the headers. This is behind "FTXUI_CLANG_TIDY", so that it + # applies only when developing FTXUI and on the CI. User's of the library + # get only the SYSTEM INTERFACE instead. + target_include_directories(${library} + PUBLIC + $ + ) + else() + target_include_directories(${library} SYSTEM + INTERFACE + $ + ) endif() - target_include_directories(${library} - PUBLIC + target_include_directories(${library} SYSTEM + INTERFACE $ - $ + ) + + target_include_directories(${library} PRIVATE - src + $ + $ ) # C++17 is used. We require fold expression at least.