Jamfile 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. # Boost.Geometry (aka GGL, Generic Geometry Library)
  2. #
  3. # Copyright (c) 2018 Mateusz Loskot <mateusz@loskot.net>
  4. #
  5. # Use, modification and distribution is subject to the Boost Software License,
  6. # Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  7. # http://www.boost.org/LICENSE_1_0.txt)
  8. import os ;
  9. import path ;
  10. import regex ;
  11. rule generate_self_contained_headers ( headers_subpath )
  12. {
  13. # This rule is based on script copied from similar rule in Boost.GIL
  14. # On CI services, test the self-contained headers on-demand only to avoid build timeouts
  15. # CI environment is common for Travis CI, AppVeyor, CircleCI, etc.
  16. # For example:
  17. # if ! [ os.environ CI ] || [ os.environ TEST_HEADERS ] {
  18. # alias self_contained_headers : [ generate_self_contained_headers ] ;
  19. # }
  20. local targets ;
  21. # NOTE: All '/' in test names are replaced with '-' because apparently
  22. # test scripts have a problem with test names containing slashes.
  23. local top_headers_path = [ path.make $(BOOST_ROOT)/libs/geometry/include/boost/geometry ] ;
  24. for local file in [ path.glob-tree $(top_headers_path)/$(headers_subpath) : *.hpp ]
  25. {
  26. local rel_file = [ path.relative-to $(top_headers_path) $(file) ] ;
  27. local target_name = [ regex.replace h/$(rel_file) "/" "-" ] ;
  28. local target_name = [ regex.replace $(target_name) "\.hpp" "" ] ;
  29. targets += [
  30. compile $(BOOST_ROOT)/libs/geometry/test/headers/main.cpp
  31. : <define>"BOOST_GEOMETRY_TEST_HEADER=$(rel_file)" <dependency>$(file)
  32. : $(target_name)
  33. ] ;
  34. }
  35. return $(targets) ;
  36. }
  37. # TODO: Review sorting to get as close as possible from general to specific
  38. # Core
  39. alias core : [ generate_self_contained_headers core ] ;
  40. alias util : [ generate_self_contained_headers util ] ;
  41. alias policies : [ generate_self_contained_headers policies ] ;
  42. alias geometries : [ generate_self_contained_headers geometries ] ;
  43. alias concepts : [ generate_self_contained_headers concepts ] ;
  44. alias arithmetic : [ generate_self_contained_headers arithmetic ] ;
  45. alias formulas : [ generate_self_contained_headers formulas ] ;
  46. alias iterators : [ generate_self_contained_headers iterators ] ;
  47. alias strategies : [ generate_self_contained_headers strategies ] ;
  48. alias srs : [ generate_self_contained_headers srs ] ;
  49. alias algorithms : [ generate_self_contained_headers algorithms ] ;
  50. alias views : [ generate_self_contained_headers views ] ;
  51. # Even though index is a separate submodule test headers here
  52. alias index : [ generate_self_contained_headers index ] ;