Jamfile 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. # Boost.GIL (Generic Image Library) - tests
  2. #
  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
  7. #
  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)
  11. import ../../config/checks/config : requires ;
  12. import os ;
  13. import path ;
  14. import regex ;
  15. import testing ;
  16. # Avoid warnings flood on Travis CI, AppVeyor, CircleCI, Azure Pipelines
  17. if ! [ os.environ CI ] && ! [ os.environ AGENT_JOBSTATUS ]
  18. {
  19. DEVELOPMENT_EXTRA_WARNINGS =
  20. <toolset>msvc:<cxxflags>/W4
  21. <toolset>gcc:<cxxflags>"-pedantic -Wextra -Wcast-align -Wconversion -Wfloat-equal -Wshadow -Wsign-promo -Wstrict-aliasing -Wunused-parameter"
  22. <toolset>clang,<variant>debug:<cxxflags>"-pedantic -Wextra -Wcast-align -Wconversion -Wfloat-equal -Wshadow -Wsign-promo -Wstrict-aliasing -Wunused-parameter -Wsign-conversion"
  23. <toolset>clang,<variant>release:<cxxflags>"-pedantic -Wextra -Wcast-align -Wconversion -Wfloat-equal -Wshadow -Wsign-promo -Wstrict-aliasing -Wunused-parameter -Wsign-conversion"
  24. <toolset>darwin:<cxxflags>"-pedantic -Wextra -Wcast-align -Wconversion -Wfloat-equal -Wshadow -Wsign-promo -Wstrict-aliasing -Wunused-parameter"
  25. ;
  26. }
  27. project
  28. :
  29. requirements
  30. <include>.
  31. # TODO: Enable concepts check for all, not just test/core
  32. #<define>BOOST_GIL_USE_CONCEPT_CHECK=1
  33. <toolset>msvc:<asynch-exceptions>on
  34. <toolset>msvc:<cxxflags>/bigobj
  35. <toolset>msvc:<define>_SCL_SECURE_NO_DEPRECATE
  36. <toolset>msvc:<define>_CRT_SECURE_NO_WARNINGS
  37. <toolset>msvc:<define>_CRT_NONSTDC_NO_DEPRECATE
  38. <toolset>msvc:<define>NOMINMAX
  39. <toolset>intel:<debug-symbols>off
  40. <toolset>gcc:<cxxflags>"-fstrict-aliasing"
  41. <toolset>darwin:<cxxflags>"-fstrict-aliasing"
  42. # variant filter for clang is necessary to allow ubsan_*
  43. # custom variants declare distinct set of <cxxflags>
  44. <toolset>clang,<variant>debug:<cxxflags>"-fstrict-aliasing"
  45. <toolset>clang,<variant>release:<cxxflags>"-fstrict-aliasing"
  46. $(DEVELOPMENT_EXTRA_WARNINGS)
  47. [ requires
  48. cxx11_constexpr
  49. cxx11_defaulted_functions
  50. cxx11_template_aliases
  51. cxx11_trailing_result_types # implies decltype and auto
  52. cxx11_variadic_templates
  53. ]
  54. ;
  55. variant gil_ubsan_integer
  56. : release
  57. :
  58. <cxxflags>"-Wno-unused -fstrict-aliasing -fno-omit-frame-pointer -fsanitize=integer -fno-sanitize-recover=integer -fsanitize-blacklist=libs/gil/.ci/blacklist.supp"
  59. <linkflags>"-fsanitize=integer"
  60. <debug-symbols>on
  61. <define>BOOST_USE_ASAN=1
  62. ;
  63. variant gil_ubsan_nullability
  64. : release
  65. :
  66. <cxxflags>"-Wno-unused -fstrict-aliasing -fno-omit-frame-pointer -fsanitize=nullability -fno-sanitize-recover=nullability -fsanitize-blacklist=libs/gil/.ci/blacklist.supp"
  67. <linkflags>"-fsanitize=nullability"
  68. <debug-symbols>on
  69. <define>BOOST_USE_ASAN=1
  70. ;
  71. variant gil_ubsan_undefined
  72. : release
  73. :
  74. <cxxflags>"-Wno-unused -fstrict-aliasing -fno-omit-frame-pointer -fsanitize=undefined -fno-sanitize-recover=undefined -fsanitize-blacklist=libs/gil/.ci/blacklist.supp"
  75. <linkflags>"-fsanitize=undefined"
  76. <debug-symbols>on
  77. <define>BOOST_USE_ASAN=1
  78. ;
  79. rule generate_self_contained_headers ( headers_subpath * : exclude_subpaths * )
  80. {
  81. # On CI services, test the self-contained headers on-demand only to avoid build timeouts
  82. # CI environment is common for Travis CI, AppVeyor, CircleCI, etc.
  83. # For example:
  84. # if ! [ os.environ CI ] || [ os.environ TEST_HEADERS ] {
  85. # alias self_contained_headers : [ generate_self_contained_headers ] ;
  86. # }
  87. local targets ;
  88. # NOTE: All '/' in test names are replaced with '-' because apparently
  89. # test scripts have a problem with test names containing slashes.
  90. local top_headers_path = [ path.make $(BOOST_ROOT)/libs/gil/include/boost/gil ] ;
  91. for local file in [ path.glob-tree $(top_headers_path)/$(headers_subpath) : *.hpp : $(exclude_subpaths) ]
  92. {
  93. local rel_file = [ path.relative-to $(top_headers_path) $(file) ] ;
  94. local target_name = [ regex.replace h/$(rel_file) "/" "-" ] ;
  95. local target_name = [ regex.replace $(target_name) "\.hpp" "" ] ;
  96. targets += [
  97. compile $(BOOST_ROOT)/libs/gil/test/header/main.cpp
  98. : <define>"BOOST_GIL_TEST_HEADER=$(rel_file)" <dependency>$(file)
  99. : $(target_name)
  100. ] ;
  101. }
  102. return $(targets) ;
  103. }
  104. build-project core ;
  105. build-project legacy ;
  106. build-project extension ;