Hi I need to compile unit tests for simple project with some warnings turned on. But I want to suppress this warnings from being arisen in an external INTERFACE
library(actually this is my fork from Boost.Leaf with added SYSTEM
option) and to achieve this I have added SYSTEM
option in target_include_directories
:
# Generated by `boostdep --cmake leaf`
# Copyright 2020 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt
cmake_minimum_required(VERSION 3.5...3.16)
project(boost_leaf VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
add_library(boost_leaf INTERFACE)
add_library(Boost::leaf ALIAS boost_leaf)
target_include_directories(boost_leaf SYSTEM INTERFACE include)
if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")
add_subdirectory(test)
endif()
This works fine on Linux and MacOS but unfortunately not for Windows because warnings keeps being arisen in the external library(here you can see errors arisen in boost/leaf/handle_errors.hpp which in theory must be suppressed)
If this can be useful the project that I try to compile can be found on github
Any idea what Iām doing wrong and how to suppress those warnings?