diff --git a/exports/taskfiles/utils/boost.yaml b/exports/taskfiles/utils/boost.yaml index d286a3d..d6b1185 100644 --- a/exports/taskfiles/utils/boost.yaml +++ b/exports/taskfiles/utils/boost.yaml @@ -2,6 +2,7 @@ version: "3" includes: checksum: "checksum.yaml" + misc: "misc.yaml" remote: "remote.yaml" set: ["u", "pipefail"] @@ -61,9 +62,8 @@ tasks: # @param {string} BUILD_DIR Directory in which to build boost. # @param {string} INSTALL_PREFIX Path prefix of where the project should be installed. # @param {string[]} [EXTRA_ARGS] Any additional arguments to pass to the build command. - # @param {int} [JOBS] The maximum number of concurrent processes to use when building. If - # omitted, the b2 default number is used. Before 1.76.0, the number was 1. Since 1.76.0, the - # default is the number of cores. + # @param {int} [JOBS={{default .G_NPROCS (env "TASK_EXTERNAL_TOOL_CONCURRENCY")}}] The maximum + # number of concurrent processes to use when building. # @param {string} [CMAKE_SETTINGS_DIR] If set, the directory where the project's CMake settings # file should be stored. build-and-install: @@ -72,7 +72,7 @@ tasks: EXTRA_ARGS: ref: "default (list) .EXTRA_ARGS" JOBS: >- - {{default "" .JOBS}} + {{default (default .G_NPROCS (env "TASK_EXTERNAL_TOOL_CONCURRENCY")) .JOBS}} requires: vars: ["GENERATE_DIR", "BUILD_DIR", "INSTALL_PREFIX"] cmds: @@ -121,9 +121,7 @@ tasks: # # Boost build-and-install parameters # @param {string} [BUILD_DIR={{.WORK_DIR}}/boost-build] Directory in which to build the project. - # @param {int} [JOBS] The maximum number of concurrent processes to use when building. If - # omitted, the b2 default number is used. Before 1.76.0, the number was 1. Since 1.76.0, the - # default is the number of cores. + # @param {int} [JOBS] The maximum number of concurrent processes to use when building. # @param {string[]} [BUILD_AND_INSTALL_ARGS] Any additional arguments to pass to boost's build # and install command. # @param {string} [CMAKE_SETTINGS_DIR] If set, the directory where the project's CMake settings @@ -155,8 +153,6 @@ tasks: {{default (printf "%s/boost-build" .WORK_DIR) .BUILD_DIR}} BUILD_AND_INSTALL_ARGS: ref: "default (list) .BUILD_AND_INSTALL_ARGS" - JOBS: >- - {{default "" .JOBS}} CMAKE_SETTINGS_DIR: >- {{default "" .CMAKE_SETTINGS_DIR}} requires: diff --git a/exports/taskfiles/utils/cmake.yaml b/exports/taskfiles/utils/cmake.yaml index f14699c..39525cf 100644 --- a/exports/taskfiles/utils/cmake.yaml +++ b/exports/taskfiles/utils/cmake.yaml @@ -14,8 +14,8 @@ tasks: # # @param {string} BUILD_DIR Directory containing the generated build system to use. # @param {string[]} [EXTRA_ARGS] Any additional arguments to pass to the build command. - # @param {int} [JOBS] The maximum number of concurrent processes to use when building. If - # omitted, the native build tool's default number is used. See `man cmake`. + # @param {int} [JOBS={{default .G_NPROCS (env "TASK_EXTERNAL_TOOL_CONCURRENCY")}}] The maximum + # number of concurrent processes to use when building. # @param {string[]} [TARGETS] A list of specific targets to build instead of the default target. build: internal: true @@ -24,7 +24,7 @@ tasks: EXTRA_ARGS: ref: "default (list) .EXTRA_ARGS" JOBS: >- - {{default "" .JOBS}} + {{default (default .G_NPROCS (env "TASK_EXTERNAL_TOOL_CONCURRENCY")) .JOBS}} TARGETS: ref: "default (list) .TARGETS" requires: @@ -153,8 +153,7 @@ tasks: # command. # @param {string[]} [CMAKE_INSTALL_ARGS] Any additional arguments to pass to the CMake install # command. - # @param {int} [CMAKE_JOBS] The maximum number of concurrent processes to use when building. If - # omitted, the native build tool's default number is used. See `man cmake`. + # @param {int} [CMAKE_JOBS] The maximum number of concurrent processes to use when building. # @param {string} [CMAKE_SETTINGS_DIR] The directory where the project's CMake settings file # should be stored. # @param {string} [CMAKE_SOURCE_DIR=.] The path, within the extraction directory, containing the @@ -172,8 +171,6 @@ tasks: ref: "default (list) .CMAKE_GEN_ARGS" CMAKE_INSTALL_ARGS: ref: "default (list) .CMAKE_INSTALL_ARGS" - CMAKE_JOBS: >- - {{default "" .CMAKE_JOBS}} CMAKE_SETTINGS_DIR: >- {{default "" .CMAKE_SETTINGS_DIR}} CMAKE_SOURCE_DIR: >- diff --git a/exports/taskfiles/utils/misc.yaml b/exports/taskfiles/utils/misc.yaml index 5bd3801..33c1999 100644 --- a/exports/taskfiles/utils/misc.yaml +++ b/exports/taskfiles/utils/misc.yaml @@ -3,6 +3,10 @@ version: "3" set: ["u", "pipefail"] shopt: ["globstar"] +vars: + G_NPROCS: + sh: "getconf _NPROCESSORS_ONLN" + tasks: replace-text: desc: "Replaces some text in a file using sed."