Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
384e48f
Use separate directory for build
sitaowang1998 Jun 8, 2025
ca3967a
Copy the folder instead of symlink
sitaowang1998 Jun 9, 2025
c70d154
Merge generate and build task; Use checksum to skip tasks
sitaowang1998 Jun 9, 2025
0d49309
Fix path
sitaowang1998 Jun 9, 2025
b5ad554
Fix typo
sitaowang1998 Jun 9, 2025
fe92a80
Use checksum to skip generate; Merge build and install and separate c…
sitaowang1998 Jun 9, 2025
5b0b96c
Fix index
sitaowang1998 Jun 9, 2025
d3775b3
Remove install checksum
sitaowang1998 Jun 9, 2025
96fc539
Remove install checksum
sitaowang1998 Jun 9, 2025
f6a856a
Fix docstring
sitaowang1998 Jun 9, 2025
5f680a4
Fix docstring
sitaowang1998 Jun 9, 2025
c57bf19
Remove use of dir
sitaowang1998 Jun 10, 2025
24c5176
Improve docstring
sitaowang1998 Jun 11, 2025
3651df2
Improve docstring
sitaowang1998 Jun 11, 2025
008fdc4
Use GENERATE_CHECKSUM_FILE instead of GENERATE_CHECKSUM
sitaowang1998 Jun 11, 2025
7271b9d
Rename BUILD_ARGS to BUILD_AND_INSTALL_ARGS
sitaowang1998 Jun 11, 2025
3df61e4
Move cmake step into build-and-install
sitaowang1998 Jun 11, 2025
e01262d
Improve docstring for build-and-install
sitaowang1998 Jun 11, 2025
037a814
Remove duplicate argument in docstring
sitaowang1998 Jun 11, 2025
65c4c60
Fix cmake
sitaowang1998 Jun 11, 2025
9786089
Copy directory without creating target directory
sitaowang1998 Jun 11, 2025
72b2964
Fix docstring
sitaowang1998 Jun 11, 2025
4311d99
Fix argument mismatch
sitaowang1998 Jun 11, 2025
e146d53
Fix docstring
sitaowang1998 Jun 11, 2025
409ffde
Merge branch 'boost-build' of github.com:sitaowang1998/yscope-dev-uti…
sitaowang1998 Jun 11, 2025
339c013
Fix default args
sitaowang1998 Jun 11, 2025
0ad5cba
Fix docstring
sitaowang1998 Jun 11, 2025
7f073d1
Apply suggestions from code review
davidlion Jun 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 34 additions & 15 deletions exports/taskfiles/utils/boost.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,34 @@ set: ["u", "pipefail"]
shopt: ["globstar"]

tasks:
# Runs the bootstrap.sh generate step in the given source directory. Boost only supports
# in-source generation and building.
# Creates a build directory that soft links the source files from `SOURCE_DIR`. Runs
# `bootstrap.sh` to generate the `b2` build tool and `project-config.jam` file in the build
# directory.
Comment thread
sitaowang1998 marked this conversation as resolved.
Outdated
#
# @param {string} SOURCE_DIR Project source directory.
# @param {string} BUILD_DIR Directory in which to build the project.
# @param {string} INSTALL_PREFIX Path prefix of where the project should be installed.
# @param {string[]} TARGETS Target libraries to build.
# @param {string[]} [EXTRA_ARGS] Any additional arguments to pass to the generate command.
generate:
internal: true
dir: "{{.SOURCE_DIR}}"
dir: "{{.BUILD_DIR}}"
vars:
EXTRA_ARGS:
ref: "default (list) .EXTRA_ARGS"
requires:
vars: ["SOURCE_DIR", "INSTALL_PREFIX", "TARGETS"]
vars: ["SOURCE_DIR", "BUILD_DIR", "INSTALL_PREFIX", "TARGETS"]
generates:
- "{{.BUILD_DIR}}/b2"
- "{{.BUILD_DIR}}/project-config.jam"
cmds:
Comment thread
sitaowang1998 marked this conversation as resolved.
Comment thread
sitaowang1998 marked this conversation as resolved.
- |
for file in "{{.SOURCE_DIR}}"/*; do
filename=$(basename "$file")
target="{{.BUILD_DIR}}"/"$filename"
[ -e "$target" ] && continue
ln -s "$file" "$target"
done
Comment thread
sitaowang1998 marked this conversation as resolved.
Outdated
- >-
./bootstrap.sh
--prefix="{{.INSTALL_PREFIX}}"
Expand All @@ -33,23 +45,23 @@ tasks:
{{- end}}

# Runs the b2 build step for boost. The caller must have previously called `generate` on
# `SOURCE_DIR` for this task to succeed.
# `BUILD_DIR` for this task to succeed.
#
# @param {string} SOURCE_DIR Directory containing the boost source.
# @param {string} BUILD_DIR Directory containing the boost source.
# @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.
build:
internal: true
dir: "{{.SOURCE_DIR}}"
dir: "{{.BUILD_DIR}}"
vars:
EXTRA_ARGS:
ref: "default (list) .EXTRA_ARGS"
Comment thread
sitaowang1998 marked this conversation as resolved.
JOBS: >-
Comment thread
sitaowang1998 marked this conversation as resolved.
{{default "" .JOBS}}
requires:
vars: ["SOURCE_DIR"]
vars: ["BUILD_DIR"]
cmds:
- >-
./b2
Expand All @@ -61,18 +73,18 @@ tasks:
{{- end}}

# Runs the b2 install step for boost. The caller must have previously called `build` on
# `SOURCE_DIR` for this task to succeed. If `CMAKE_SETTINGS_DIR` is set, a settings file will be
# `BUILD_DIR` for this task to succeed. If `CMAKE_SETTINGS_DIR` is set, a settings file will be
# created in that directory, containing a `boost_ROOT` CMake variable that points to
# `INSTALL_PREFIX`.
#
# @param {string} SOURCE_DIR Directory containing the boost source.
# @param {string} BUILD_DIR Directory containing the boost source.
Comment thread
sitaowang1998 marked this conversation as resolved.
Outdated
# @param {string} INSTALL_PREFIX Path prefix of where the project should be installed.
# @param {string} [CMAKE_SETTINGS_DIR] If set, the directory where the project's CMake settings
# file should be stored.
# @param {string[]} [EXTRA_ARGS] Any additional arguments to pass to the install command.
install:
internal: true
dir: "{{.SOURCE_DIR}}"
dir: "{{.BUILD_DIR}}"
vars:
EXTRA_ARGS:
ref: "default (list) .EXTRA_ARGS"
Expand All @@ -81,7 +93,7 @@ tasks:
CMAKE_SETTINGS_DIR: >-
{{default "" .CMAKE_SETTINGS_DIR}}
requires:
vars: ["SOURCE_DIR", "INSTALL_PREFIX"]
vars: ["BUILD_DIR", "INSTALL_PREFIX"]
cmds:
- >-
./b2
Expand All @@ -97,13 +109,15 @@ tasks:
\"Package root for boost.\"
)" >> "{{.CMAKE_SETTINGS_DIR}}/boost.cmake"
{{- end}}

# Downloads boost from `URL` and installs boost.
#
# General parameters
# @param {string} [WORK_DIR={{.ROOT_DIR}}] Base directory to store the install and src
# @param {string} [WORK_DIR={{.ROOT_DIR}}] Base directory to store the src, build and install
# directories inside.
Comment thread
sitaowang1998 marked this conversation as resolved.
Outdated
# @param {string} [SOURCE_DIR={{.WORK_DIR}}/boost-src] Directory in which to extract the tar
# file.
# @param {string} [BUILD_DIR={{.WORK_DIR}}/boost-build] Directory in which to build the project.
Comment thread
sitaowang1998 marked this conversation as resolved.
Outdated
#
# Download parameters
# @param {string} FILE_SHA256 Content hash to verify the downloaded tar file against.
Expand Down Expand Up @@ -134,6 +148,8 @@ tasks:
{{default .ROOT_DIR .WORK_DIR}}
SOURCE_DIR: >-
{{default (printf "%s/boost-src" .WORK_DIR) .SOURCE_DIR}}
BUILD_DIR: >-
{{default (printf "%s/boost-build" .WORK_DIR) .BUILD_DIR}}

# Boost generate parameters
INSTALL_PREFIX: >-
Expand Down Expand Up @@ -163,23 +179,26 @@ tasks:
OUTPUT_DIR: "{{.SOURCE_DIR}}"
URL: "{{.URL}}"
cmds:
- >-
mkdir -p "{{.BUILD_DIR}}"
- task: "generate"
vars:
SOURCE_DIR: "{{.SOURCE_DIR}}"
BUILD_DIR: "{{.BUILD_DIR}}"
INSTALL_PREFIX: "{{.INSTALL_PREFIX}}"
TARGETS:
ref: ".TARGETS"
EXTRA_ARGS:
ref: ".GEN_ARGS"
- task: "build"
vars:
SOURCE_DIR: "{{.SOURCE_DIR}}"
BUILD_DIR: "{{.BUILD_DIR}}"
JOBS: "{{.JOBS}}"
EXTRA_ARGS:
ref: ".BUILD_ARGS"
- task: "install"
vars:
SOURCE_DIR: "{{.SOURCE_DIR}}"
BUILD_DIR: "{{.BUILD_DIR}}"
INSTALL_PREFIX: "{{.INSTALL_PREFIX}}"
CMAKE_SETTINGS_DIR: "{{.CMAKE_SETTINGS_DIR}}"
EXTRA_ARGS:
Expand Down