Jamfile.v2 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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. import path ;
  8. import configure ;
  9. import ../../build/log-platform-config ;
  10. rule has-config-flag ( flag : properties * )
  11. {
  12. if ( "<define>$(flag)" in $(properties) || "<define>$(flag)=1" in $(properties) )
  13. {
  14. return 1 ;
  15. }
  16. else
  17. {
  18. return ;
  19. }
  20. }
  21. rule check-message-compiler ( properties * )
  22. {
  23. local result ;
  24. if <target-os>windows in $(properties)
  25. {
  26. if ! [ has-config-flag BOOST_LOG_WITHOUT_EVENT_LOG : $(properties) ]
  27. {
  28. local has_mc = [ configure.builds /boost/log/message-compiler//test-availability : $(properties) : message-compiler ] ;
  29. if ! $(has_mc)
  30. {
  31. result = <define>BOOST_LOG_WITHOUT_EVENT_LOG ;
  32. }
  33. }
  34. else
  35. {
  36. # This branch is needed to fix building with MinGW
  37. result = <define>BOOST_LOG_WITHOUT_EVENT_LOG ;
  38. }
  39. }
  40. else
  41. {
  42. result = <define>BOOST_LOG_WITHOUT_EVENT_LOG ;
  43. }
  44. return $(result) ;
  45. }
  46. project
  47. : requirements
  48. <conditional>@log-platform-config.set-platform-defines
  49. <conditional>@check-message-compiler
  50. <link>shared:<define>BOOST_ALL_DYN_LINK
  51. <toolset>msvc:<define>_SCL_SECURE_NO_WARNINGS
  52. <toolset>msvc:<define>_SCL_SECURE_NO_DEPRECATE
  53. <toolset>msvc:<define>_CRT_SECURE_NO_WARNINGS
  54. <toolset>msvc:<define>_CRT_SECURE_NO_DEPRECATE
  55. <toolset>msvc:<cxxflags>/bigobj
  56. <toolset>msvc:<cxxflags>/wd4503 # decorated name length exceeded, name was truncated
  57. <toolset>msvc:<cxxflags>/wd4456 # declaration of 'A' hides previous local declaration
  58. <toolset>msvc:<cxxflags>/wd4459 # declaration of 'A' hides global declaration
  59. <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
  60. <toolset>intel-win:<define>_SCL_SECURE_NO_WARNINGS
  61. <toolset>intel-win:<define>_SCL_SECURE_NO_DEPRECATE
  62. <toolset>intel-win:<define>_CRT_SECURE_NO_WARNINGS
  63. <toolset>intel-win:<define>_CRT_SECURE_NO_DEPRECATE
  64. <toolset>darwin:<cxxflags>-ftemplate-depth-1024
  65. <toolset>gcc:<cxxflags>-ftemplate-depth-1024
  66. <toolset>gcc:<cxxflags>-fno-strict-aliasing # avoids strict aliasing violations in other Boost components
  67. # Disable Intel warnings:
  68. # warning #177: function "X" was declared but never referenced
  69. # warning #780: using-declaration ignored -- it refers to the current namespace
  70. # warning #2196: routine is both "inline" and "noinline"
  71. # remark #1782: #pragma once is obsolete. Use #ifndef guard instead.
  72. # remark #193: zero used for undefined preprocessing identifier "X"
  73. # remark #304: access control not specified ("public" by default)
  74. # remark #981: operands are evaluated in unspecified order
  75. # remark #1418: external function definition with no prior declaration
  76. # Mostly comes from Boost.Phoenix: warning #411: class "X" defines no constructor to initialize the following: reference member "Y"...
  77. # warning #734: "X" (declared at line N of "file.hpp"), required for copy that was eliminated, is inaccessible
  78. # warning #279: controlling expression is constant
  79. <toolset>intel-win:<cxxflags>"/Qwd177,780,2196,1782,193,304,981,1418,411,734,279"
  80. <toolset>intel-linux:<cxxflags>"-wd177,780,2196,1782,193,304,981,1418,411,734,279"
  81. <toolset>intel-darwin:<cxxflags>"-wd177,780,2196,1782,193,304,981,1418,411,734,279"
  82. # Boost.Interprocess does not compile on Cygwin: https://github.com/boostorg/interprocess/issues/76
  83. <target-os>cygwin:<define>BOOST_LOG_WITHOUT_IPC
  84. <library>/boost/log//boost_log
  85. <library>/boost/log//boost_log_setup
  86. <library>/boost/date_time//boost_date_time
  87. <library>/boost/filesystem//boost_filesystem
  88. <library>/boost/thread//boost_thread
  89. <threading>multi
  90. ;
  91. # Compiles each .cpp file in this directory into a separate executable
  92. rule compile_all
  93. {
  94. #ECHO executing compile_all rule ;
  95. local all_rules = ;
  96. for local file in [ glob *.cpp ]
  97. {
  98. local exename = [ MATCH "([^.]*).cpp$" : [ path.basename $(file) ] ] ;
  99. #ECHO "exename = $(exename)" ;
  100. all_rules += [ exe $(exename) : $(file) ] ;
  101. }
  102. #ECHO $(all_rules) ;
  103. return $(all_rules) ;
  104. }
  105. compile_all ;