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