From 078c68a2e5f04331bf53d3cdee2cffe031056154 Mon Sep 17 00:00:00 2001 From: Samuel Debionne Date: Sat, 29 May 2021 02:55:04 +0200 Subject: [PATCH] Add default value for cxx and cxxflags options for the cxx toolset (#24) Add default value for cxx and cxxflags options for the cxx toolset --- src/engine/build.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/engine/build.sh b/src/engine/build.sh index 1a9f8c8a7..b36573b02 100755 --- a/src/engine/build.sh +++ b/src/engine/build.sh @@ -276,12 +276,19 @@ if test_true ${B2_HELP_OPT} ; then error_exit fi -# If we have a CXX but no B2_TOLSET specified by the user we assume they meant +# If we have a CXX but no B2_TOOLSET specified by the user we assume they meant # "cxx" as the toolset. if test "${B2_CXX_OPT}" != "" -a "${B2_TOOLSET}" = "" ; then B2_TOOLSET=cxx fi +# If we have B2_TOOLSET=cxx but no B2_CXX_OPT nor B2_CXXFLAGS_OPT specified by the user +# we assume they meant $CXX and $CXXFLAGS. +if test "${B2_TOOLSET}" = "cxx" -a "${B2_CXX_OPT}" = "" -a "${B2_CXXFLAGS_OPT}" = "" ; then + B2_CXX_OPT="${CXX}" + B2_CXXFLAGS_OPT="${CXXFLAGS}" +fi + # Guess toolset, or toolset commands. check_toolset TOOLSET_CHECK=$?