Jamfile.v2 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. #
  2. # Copyright Andrey Semashev 2007 - 2015.
  3. # Distributed under the Boost Software License, Version 1.0.
  4. # (See accompanying file LICENSE_1_0.txt or copy at
  5. # http://www.boost.org/LICENSE_1_0.txt)
  6. #
  7. # The file was adapted from libs/tr2/test/Jamfile.v2 by John Maddock.
  8. import testing ;
  9. import path ;
  10. import regex ;
  11. import os ;
  12. import ../build/log-platform-config ;
  13. project
  14. : requirements
  15. <conditional>@log-platform-config.set-platform-defines
  16. <include>common
  17. # Disable warnings about using 'insecure' standard C functions
  18. <toolset>msvc:<define>_SCL_SECURE_NO_WARNINGS
  19. <toolset>msvc:<define>_SCL_SECURE_NO_DEPRECATE
  20. <toolset>msvc:<define>_CRT_SECURE_NO_WARNINGS
  21. <toolset>msvc:<define>_CRT_SECURE_NO_DEPRECATE
  22. <toolset>intel-win:<define>_SCL_SECURE_NO_WARNINGS
  23. <toolset>intel-win:<define>_SCL_SECURE_NO_DEPRECATE
  24. <toolset>intel-win:<define>_CRT_SECURE_NO_WARNINGS
  25. <toolset>intel-win:<define>_CRT_SECURE_NO_DEPRECATE
  26. <toolset>msvc:<cxxflags>/bigobj
  27. <toolset>msvc:<cxxflags>/wd4503 # decorated name length exceeded, name was truncated
  28. <toolset>msvc:<cxxflags>/wd4456 # declaration of 'A' hides previous local declaration
  29. <toolset>msvc:<cxxflags>/wd4459 # declaration of 'A' hides global declaration
  30. <toolset>msvc:<cxxflags>/wd4003 # not enough actual parameters for macro 'X' - caused by BOOST_PP_IS_EMPTY and BOOST_PP_IS_BEGIN_PARENS which are used by Fusion
  31. <toolset>msvc:<cxxflags>/wd4355 # 'this' : used in base member initializer list
  32. # Disable Intel warnings:
  33. # warning #177: function "X" was declared but never referenced
  34. # warning #780: using-declaration ignored -- it refers to the current namespace
  35. # warning #2196: routine is both "inline" and "noinline"
  36. # remark #1782: #pragma once is obsolete. Use #ifndef guard instead.
  37. # remark #193: zero used for undefined preprocessing identifier "X"
  38. # remark #304: access control not specified ("public" by default)
  39. # remark #981: operands are evaluated in unspecified order
  40. # remark #1418: external function definition with no prior declaration
  41. # Mostly comes from Boost.Phoenix: warning #411: class "X" defines no constructor to initialize the following: reference member "Y"...
  42. # warning #734: "X" (declared at line N of "file.hpp"), required for copy that was eliminated, is inaccessible
  43. # warning #279: controlling expression is constant
  44. <toolset>intel-win:<cxxflags>"/Qwd177,780,2196,1782,193,304,981,1418,411,734,279"
  45. <toolset>intel-linux:<cxxflags>"-wd177,780,2196,1782,193,304,981,1418,411,734,279"
  46. <toolset>intel-darwin:<cxxflags>"-wd177,780,2196,1782,193,304,981,1418,411,734,279"
  47. <toolset>darwin:<cxxflags>-ftemplate-depth-1024
  48. <toolset>gcc:<cxxflags>-ftemplate-depth-1024
  49. <toolset>gcc:<cxxflags>-fno-strict-aliasing # avoids strict aliasing violations in other Boost components
  50. # Boost.Interprocess does not compile on Cygwin: https://github.com/boostorg/interprocess/issues/76
  51. <target-os>cygwin:<define>BOOST_LOG_WITHOUT_IPC
  52. <library>/boost/log//boost_log
  53. <library>/boost/log//boost_log_setup
  54. <library>/boost/date_time//boost_date_time
  55. <library>/boost/regex//boost_regex
  56. <library>/boost/filesystem//boost_filesystem
  57. <library>/boost/test//boost_unit_test_framework
  58. <threading>single:<define>BOOST_LOG_NO_THREADS
  59. <threading>multi:<library>/boost/thread//boost_thread
  60. : default-build
  61. # Testers typically don't specify threading environment and the library can be built and tested for single and multi. I'm more interested in multi though.
  62. <threading>multi
  63. # <link>static
  64. ;
  65. # this rule enumerates through all the sources and invokes
  66. # the run rule for each source, the result is a list of all
  67. # the run rules, which we can pass on to the test_suite rule:
  68. rule test_all
  69. {
  70. local all_rules ;
  71. local file ;
  72. if ! [ os.environ BOOST_LOG_TEST_WITHOUT_SELF_CONTAINED_HEADER_TESTS ]
  73. {
  74. local headers_path = [ path.make $(BOOST_ROOT)/libs/log/include/boost/log ] ;
  75. for file in [ path.glob-tree $(headers_path) : *.hpp : detail ]
  76. {
  77. local rel_file = [ path.relative-to $(headers_path) $(file) ] ;
  78. # Note: The test name starts with '~' in order to group these tests in the test report table, preferably at the end.
  79. # All '/' are replaced with '-' because apparently test scripts have a problem with test names containing slashes.
  80. local test_name = [ regex.replace ~hdr/$(rel_file) "/" "-" ] ;
  81. #ECHO $(rel_file) ;
  82. all_rules += [ compile compile/self_contained_header.cpp : <define>"BOOST_LOG_TEST_HEADER=$(rel_file)" <dependency>$(file) : $(test_name) ] ;
  83. }
  84. }
  85. for file in [ glob compile/*.cpp ]
  86. {
  87. if [ path.basename $(file) ] != "self_contained_header.cpp"
  88. {
  89. all_rules += [ compile $(file) ] ;
  90. }
  91. }
  92. for file in [ glob compile_fail/*.cpp ]
  93. {
  94. all_rules += [ compile-fail $(file) ] ;
  95. }
  96. for file in [ glob run/*.cpp ]
  97. {
  98. all_rules += [ run $(file) ] ;
  99. }
  100. if ! [ os.environ BOOST_LOG_TEST_WITHOUT_EXAMPLES ]
  101. {
  102. all_rules += [ build-project ../example ] ;
  103. }
  104. #ECHO All rules: $(all_rules) ;
  105. return $(all_rules) ;
  106. }
  107. test-suite log : [ test_all ] ;