@@ -3,8 +3,6 @@ version: "3"
33vars :
44 G_CATCH2_LIB_NAME : " Catch2"
55 G_CATCH2_WORK_DIR : " {{.G_DEPS_DIR}}/{{.G_CATCH2_LIB_NAME}}"
6- G_OUTCOME_LIB_NAME : " outcome"
7- G_OUTCOME_WORK_DIR : " {{.G_DEPS_DIR}}/{{.G_OUTCOME_LIB_NAME}}"
86 G_QUICKCPPLIB_LIB_NAME : " quickcpplib"
97 G_QUICKCPPLIB_WORK_DIR : " {{.G_DEPS_DIR}}/{{.G_QUICKCPPLIB_LIB_NAME}}"
108
2624 install-all-run :
2725 internal : true
2826 deps :
27+ - " install-boost"
2928 - " install-Catch2"
30- - " install-outcome"
3129
3230 install-all-finish :
3331 internal : true
@@ -58,12 +56,12 @@ tasks:
5856 internal : true
5957 run : " once"
6058 cmds :
61- - task : " :utils:cmake- install-remote-tar"
59+ - task : " :utils:cmake: install-remote-tar"
6260 vars :
63- NAME : " {{.G_CATCH2_LIB_NAME}}"
61+ CMAKE_PACKAGE_NAME : " {{.G_CATCH2_LIB_NAME}}"
6462 WORK_DIR : " {{.G_CATCH2_WORK_DIR}}"
65- FILE_SHA256 : " 1ab2de20460d4641553addfdfe6acd4109d871d5531f8f519a52ea4926303087"
66- URL : " https://github.com/catchorg/Catch2/archive/refs/tags/v3.8.0.tar.gz"
63+ TAR_SHA256 : " 1ab2de20460d4641553addfdfe6acd4109d871d5531f8f519a52ea4926303087"
64+ TAR_URL : " https://github.com/catchorg/Catch2/archive/refs/tags/v3.8.0.tar.gz"
6765 - task : " add-package-root-to-cmake-settings"
6866 vars :
6967 NAME : " {{.G_CATCH2_LIB_NAME}}"
@@ -86,5 +84,162 @@ tasks:
8684 - " process"
8785 - " program_options"
8886 - " regex"
89- - " system"
87+ - " system"
88+
89+ # Runs the bootstrap.sh generate step in the given source directory. Boost only supports
90+ # in-source generation and building.
91+ #
92+ # @param {string} SOURCE_DIR Project source directory.
93+ # @param {string} INSTALL_PREFIX Path prefix of where the project should be installed.
94+ # @param {string[]} TARGETS Target libraries to build.
95+ # @param {string[]} [EXTRA_ARGS] Any additional arguments to pass to the generate command.
96+ boost-generate :
97+ internal : true
98+ dir : " {{.SOURCE_DIR}}"
99+ cmds :
100+ - >-
101+ ./bootstrap.sh
102+ --prefix="{{.INSTALL_PREFIX}}"
103+ --exec-prefix="{{.INSTALL_PREFIX}}"
104+ --with-libraries={{(join "," .TARGETS)}}
105+ {{- range .EXTRA_ARGS}}
106+ "{{.}}"
107+ {{- end}}
108+
109+ # Runs the b2 build step for boost. The caller must have previously called `generate` on
110+ # `SOURCE_DIR` for this task to succeed.
111+ #
112+ # @param {string} SOURCE_DIR Directory containing the boost source.
113+ # @param {string[]} [EXTRA_ARGS] Any additional arguments to pass to the build command.
114+ # @param {int} [JOBS] The maximum number of concurrent processes to use when building. If
115+ # omitted, the b2 default number is used. Before 1.76.0, the number was 1. Since 1.76.0, the
116+ # default is the number of cores.
117+ boost-build :
118+ internal : true
119+ dir : " {{.SOURCE_DIR}}"
120+ cmds :
121+ - >-
122+ ./b2
123+ {{- range .EXTRA_ARGS}}
124+ "{{.}}"
125+ {{- end}}
126+ {{- if .JOBS}}
127+ "-j{{.JOBS}}"
128+ {{- end}}
129+
130+ # Runs the b2 install step for boost. The caller must have previously called `build` on
131+ # `SOURCE_DIR` for this task to succeed. If `CMAKE_SETTINGS_DIR` is set, a settings file will be
132+ # created in that directory, containing a `boost_ROOT` CMake variable that points to
133+ # `INSTALL_PREFIX`.
134+ #
135+ # @param {string} SOURCE_DIR Directory containing the boost source.
136+ # @param {string} INSTALL_PREFIX Path prefix of where the project should be installed.
137+ # @param {string} [CMAKE_SETTINGS_DIR] If set, the directory where the project's CMake settings
138+ # file should be stored.
139+ # @param {string[]} [EXTRA_ARGS] Any additional arguments to pass to the install command.
140+ boost-install :
141+ internal : true
142+ dir : " {{.SOURCE_DIR}}"
143+ cmds :
144+ - >-
145+ ./b2
146+ install
147+ {{- range .EXTRA_ARGS}}
148+ "{{.}}"
149+ {{- end}}
150+ - >-
151+ {{- if .CMAKE_SETTINGS_DIR}}
152+ echo "set(BOOST_ROOT
153+ \"{{.INSTALL_PREFIX}}\"
154+ CACHE PATH
155+ \"Package root for boost.\"
156+ )" >> "{{.CMAKE_SETTINGS_DIR}}/boost.cmake"
157+ {{- end}}
158+
159+ # Downloads boost from `URL` and installs boost.
160+ #
161+ # General parameters
162+ # @param {string} [WORK_DIR={{.TASK_DIR}}] Base directory to store the install and src
163+ # directories inside.
164+ # @param {string} [SOURCE_DIR={{.WORK_DIR}}/boost-src] Directory in which to extract the tar
165+ # file.
166+ #
167+ # Download parameters
168+ # @param {string} FILE_SHA256 Content hash to verify the downloaded tar file against.
169+ # @param {string} URL
170+ #
171+ # Boost generate parameters
172+ # @param {string} [INSTALL_PREFIX={{.WORK_DIR}}/boost-install] Path prefix of where the project
173+ # should be installed.
174+ # @param {string[]} TARGETS Target libraries to build.
175+ # @param {string[]} [GEN_ARGS] Any additional arguments to pass to the generate command.
176+ #
177+ # Boost build parameters
178+ # @param {int} [JOBS] The maximum number of concurrent processes to use when building. If
179+ # omitted, the b2 default number is used. Before 1.76.0, the number was 1. Since 1.76.0, the
180+ # default is the number of cores.
181+ # @param {string[]} [BUILD_ARGS] Any additional arguments to pass to the build command.
182+ #
183+ # Boost install parameters
184+ # @param {string[]} [INSTALL_ARGS] Any additional arguments to pass to the install command.
185+ # @param {string} [CMAKE_SETTINGS_DIR] If set, the directory where the project's CMake settings
186+ # file should be stored.
187+ boost-download-and-install :
188+ internal : true
189+ label : " {{.TASK}}:{{.URL}}-{{.INSTALL_PREFIX}}"
190+ vars :
191+ # General parameters
192+ WORK_DIR : >-
193+ {{default .ROOT_DIR .WORK_DIR}}
194+ SOURCE_DIR : >-
195+ {{default (printf "%s/boost-src" .WORK_DIR) .SOURCE_DIR}}
196+
197+ # Boost generate parameters
198+ INSTALL_PREFIX : >-
199+ {{default (printf "%s/boost-install" .WORK_DIR) .INSTALL_PREFIX}}
200+ TARGETS :
201+ ref : " default (list) .TARGETS"
202+ GEN_ARGS :
203+ ref : " default (list) .GEN_ARGS"
90204
205+ # Boost build parameters
206+ BUILD_ARGS :
207+ ref : " default (list) .BUILD_ARGS"
208+ JOBS : >-
209+ {{default "" .JOBS}}
210+
211+ # Boost install parameters
212+ INSTALL_ARGS :
213+ ref : " default (list) .INSTALL_ARGS"
214+ CMAKE_SETTINGS_DIR : >-
215+ {{default "" .CMAKE_SETTINGS_DIR}}
216+ requires :
217+ vars : ["FILE_SHA256", "URL"]
218+ deps :
219+ - task : " :utils:remote:download-and-extract-tar"
220+ vars :
221+ FILE_SHA256 : " {{.FILE_SHA256}}"
222+ OUTPUT_DIR : " {{.SOURCE_DIR}}"
223+ URL : " {{.URL}}"
224+ cmds :
225+ - task : " boost-generate"
226+ vars :
227+ SOURCE_DIR : " {{.SOURCE_DIR}}"
228+ INSTALL_PREFIX : " {{.INSTALL_PREFIX}}"
229+ TARGETS :
230+ ref : " .TARGETS"
231+ EXTRA_ARGS :
232+ ref : " .GEN_ARGS"
233+ - task : " boost-build"
234+ vars :
235+ SOURCE_DIR : " {{.SOURCE_DIR}}"
236+ JOBS : " {{.JOBS}}"
237+ EXTRA_ARGS :
238+ ref : " .BUILD_ARGS"
239+ - task : " boost-install"
240+ vars :
241+ SOURCE_DIR : " {{.SOURCE_DIR}}"
242+ INSTALL_PREFIX : " {{.INSTALL_PREFIX}}"
243+ CMAKE_SETTINGS_DIR : " {{.CMAKE_SETTINGS_DIR}}"
244+ EXTRA_ARGS :
245+ ref : " .INSTALL_ARGS"
0 commit comments