1 # Boost.GIL (Generic Image Library) - tests
3 # Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
4 # Copyright (c) 2018-2019 Mateusz Loskot <mateusz@loskot.net>
5 # Copyright (c) 2018 Dmitry Arkhipov
6 # Copyright (c) 2007-2015 Andrey Semashev
8 # Use, modification and distribution is subject to the Boost Software License,
9 # Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
10 # http://www.boost.org/LICENSE_1_0.txt)
12 import ../../config/checks/config : requires ;
18 # Avoid warnings flood on Travis CI, AppVeyor, CircleCI, Azure Pipelines
19 if ! [ os.environ CI ] && ! [ os.environ AGENT_JOBSTATUS ]
21 DEVELOPMENT_EXTRA_WARNINGS =
22 <toolset>msvc:<cxxflags>/W4
23 <toolset>gcc:<cxxflags>"-pedantic -Wextra -Wcast-align -Wconversion -Wfloat-equal -Wshadow -Wsign-promo -Wstrict-aliasing -Wunused-parameter"
24 <toolset>clang,<variant>debug:<cxxflags>"-pedantic -Wextra -Wcast-align -Wconversion -Wfloat-equal -Wshadow -Wsign-promo -Wstrict-aliasing -Wunused-parameter -Wsign-conversion"
25 <toolset>clang,<variant>release:<cxxflags>"-pedantic -Wextra -Wcast-align -Wconversion -Wfloat-equal -Wshadow -Wsign-promo -Wstrict-aliasing -Wunused-parameter -Wsign-conversion"
26 <toolset>darwin:<cxxflags>"-pedantic -Wextra -Wcast-align -Wconversion -Wfloat-equal -Wshadow -Wsign-promo -Wstrict-aliasing -Wunused-parameter"
34 # TODO: Enable concepts check for all, not just test/core
35 #<define>BOOST_GIL_USE_CONCEPT_CHECK=1
36 <toolset>msvc:<asynch-exceptions>on
37 <toolset>msvc:<cxxflags>/bigobj
38 <toolset>msvc:<define>_SCL_SECURE_NO_DEPRECATE
39 <toolset>msvc:<define>_CRT_SECURE_NO_WARNINGS
40 <toolset>msvc:<define>_CRT_NONSTDC_NO_DEPRECATE
41 <toolset>msvc:<define>NOMINMAX
42 <toolset>intel:<debug-symbols>off
43 <toolset>gcc:<cxxflags>"-fstrict-aliasing"
44 <toolset>darwin:<cxxflags>"-fstrict-aliasing"
45 # variant filter for clang is necessary to allow ubsan_*
46 # custom variants declare distinct set of <cxxflags>
47 <toolset>clang,<variant>debug:<cxxflags>"-fstrict-aliasing"
48 <toolset>clang,<variant>release:<cxxflags>"-fstrict-aliasing"
49 $(DEVELOPMENT_EXTRA_WARNINGS)
52 cxx11_defaulted_functions
53 cxx11_template_aliases
54 cxx11_trailing_result_types # implies decltype and auto
55 cxx11_variadic_templates
59 variant gil_ubsan_integer
62 <cxxflags>"-Wno-unused -fstrict-aliasing -fno-omit-frame-pointer -fsanitize=integer -fno-sanitize-recover=integer -fsanitize-blacklist=libs/gil/.ci/blacklist.supp"
63 <linkflags>"-fsanitize=integer"
65 <define>BOOST_USE_ASAN=1
68 variant gil_ubsan_nullability
71 <cxxflags>"-Wno-unused -fstrict-aliasing -fno-omit-frame-pointer -fsanitize=nullability -fno-sanitize-recover=nullability -fsanitize-blacklist=libs/gil/.ci/blacklist.supp"
72 <linkflags>"-fsanitize=nullability"
74 <define>BOOST_USE_ASAN=1
77 variant gil_ubsan_undefined
80 <cxxflags>"-Wno-unused -fstrict-aliasing -fno-omit-frame-pointer -fsanitize=undefined -fno-sanitize-recover=undefined -fsanitize-blacklist=libs/gil/.ci/blacklist.supp"
81 <linkflags>"-fsanitize=undefined"
83 <define>BOOST_USE_ASAN=1
86 rule generate_self_contained_headers ( headers_subpath * : exclude_subpaths * )
88 # On CI services, test the self-contained headers on-demand only to avoid build timeouts
89 # CI environment is common for Travis CI, AppVeyor, CircleCI, etc.
91 # if ! [ os.environ CI ] || [ os.environ TEST_HEADERS ] {
92 # alias self_contained_headers : [ generate_self_contained_headers ] ;
97 # NOTE: All '/' in test names are replaced with '-' because apparently
98 # test scripts have a problem with test names containing slashes.
100 local top_headers_path = [ path.make $(BOOST_ROOT)/libs/gil/include/boost/gil ] ;
102 for local file in [ path.glob-tree $(top_headers_path)/$(headers_subpath) : *.hpp : $(exclude_subpaths) ]
104 local rel_file = [ path.relative-to $(top_headers_path) $(file) ] ;
105 local target_name = [ regex.replace h/$(rel_file) "/" "-" ] ;
106 local target_name = [ regex.replace $(target_name) "\.hpp" "" ] ;
108 compile $(BOOST_ROOT)/libs/gil/test/header/main.cpp
109 : <define>"BOOST_GIL_TEST_HEADER=$(rel_file)" <dependency>$(file)
118 build-project legacy ;
119 build-project extension ;