11#! /bin/bash
22#
33# Copyright 2017 - 2019 James E. King III
4- # Copyright 2020 - 2025 Alexander Grund
4+ # Copyright 2020 - 2026 Alexander Grund
55# Distributed under the Boost Software License, Version 1.0.
66# (See accompanying file LICENSE_1_0.txt or copy at
77# http://www.boost.org/LICENSE_1_0.txt)
6060
6161# default parallel build jobs: number of CPUs available + 1
6262if [ -z " ${B2_JOBS:- } " ]; then
63- pythonexecutable=$( get_python_executable)
64- cpus=$( grep -c ' processor' /proc/cpuinfo || $pythonexecutable -c ' import multiprocessing as mp; print(mp.cpu_count())' || echo " 2" )
63+ if ! cpus=$( grep -c ' processor' /proc/cpuinfo) ; then
64+ if pythonexecutable=$( get_python_executable) ; then
65+ cpus=$( $pythonexecutable -c ' import multiprocessing as mp; print(mp.cpu_count())' || echo " 2" )
66+ else
67+ cpus=2
68+ fi
69+ fi
6570 export B2_JOBS=$(( cpus + 1 ))
6671fi
6772
@@ -97,14 +102,9 @@ if ((${B2_CI_VERSION:-1} > 0)); then
97102
98103 B2_ARGS=(
99104 ${B2_TOOLSET: +" toolset=$B2_TOOLSET " }
100- " cxxstd=$B2_CXXSTD "
105+ ${B2_CXXSTD : + " cxxstd=$B2_CXXSTD " }
101106 ${B2_CXXFLAGS: +" cxxflags=$B2_CXXFLAGS " }
102- )
103- append_b2_args B2_DEFINES define
104- append_b2_args B2_INCLUDE include
105- # shellcheck disable=SC2206
106- B2_ARGS=(
107- " ${B2_ARGS[@]} "
107+ ${B2_TARGET_OS: +" target-os=$B2_TARGET_OS " }
108108 ${B2_LINKFLAGS: +" linkflags=$B2_LINKFLAGS " }
109109 ${B2_TESTFLAGS:- }
110110 ${B2_ADDRESS_MODEL: +address-model=$B2_ADDRESS_MODEL }
@@ -117,8 +117,16 @@ if ((${B2_CI_VERSION:-1} > 0)); then
117117 ${B2_TSAN: +thread-sanitizer=norecover}
118118 ${B2_UBSAN: +undefined-sanitizer=norecover}
119119 -j" ${B2_JOBS} "
120- ${B2_FLAGS:- }
121120 )
121+ append_b2_args B2_DEFINES define
122+ append_b2_args B2_INCLUDE include
123+ # clang-win requires to use the linker for the manifest
124+ if [[ ${B2_TOOLSET:- } == " clang-win" ]]; then
125+ B2_ARGS+=(embed-manifest-via=linker)
126+ fi
127+
128+ # shellcheck disable=SC2206
129+ B2_ARGS+=(${B2_FLAGS:- } )
122130else
123131 # Legacy codepath for compatibility for for old versions of the .github/*.yml files:
124132 # In (most) variables the prefix (such as "cxxflags=" for B2_CXXFLAGS) was included in the value, so it isn't added (again) here
0 commit comments