Skip to content

Commit df085d1

Browse files
committed
Switch to cmake lib install for ystdlib-cpp
1 parent 9d66322 commit df085d1

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

components/core/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,8 @@ endif()
293293

294294
# Add ystdlib
295295
if(CLP_NEED_YSTDLIB)
296-
set(YSTDLIB_CPP_BUILD_TESTING OFF)
297-
add_subdirectory("${CLP_YSTDLIB_SOURCE_DIRECTORY}" "${CMAKE_BINARY_DIR}/ystdlib" EXCLUDE_FROM_ALL)
296+
find_package(ystdlib REQUIRED)
297+
message(STATUS "Found ystdlib-cpp ${ystdlib_VERSION}")
298298
endif()
299299

300300
if(CLP_NEED_ZSTD)

taskfiles/deps/main.yaml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ vars:
1919

2020
# Library names
2121
G_BOOST_LIB_NAME: "Boost"
22+
G_CATCH2_LIB_NAME: "Catch2"
2223
G_FMT_LIB_NAME: "fmt"
2324
G_GSL_LIB_NAME: "Microsoft.GSL"
2425

@@ -221,7 +222,7 @@ tasks:
221222
- "-DCMAKE_CXX_STANDARD=20"
222223
- "-DCMAKE_CXX_STANDARD_REQUIRED=ON"
223224
- "-DCMAKE_INSTALL_MESSAGE=LAZY"
224-
LIB_NAME: "Catch2"
225+
LIB_NAME: "{{.G_CATCH2_LIB_NAME}}"
225226
TARBALL_SHA256: "1ab2de20460d4641553addfdfe6acd4109d871d5531f8f519a52ea4926303087"
226227
TARBALL_URL: "https://github.com/catchorg/Catch2/archive/refs/tags/v3.8.0.tar.gz"
227228

@@ -512,23 +513,20 @@ tasks:
512513

513514
ystdlib:
514515
internal: true
515-
vars:
516-
LIB_NAME: "ystdlib"
517-
YSTDLIB_OUTPUT_DIR: "{{.G_DEPS_CORE_DIR}}/{{.LIB_NAME}}-src"
518516
run: "once"
519517
deps:
520-
- task: "utils:init"
518+
- task: "boost"
519+
- task: "catch2"
521520
cmds:
522-
- task: "yscope-dev-utils:remote:download-and-extract-tar"
521+
- task: "utils:install-remote-cmake-lib"
523522
vars:
524-
CHECKSUM_FILE: "{{.G_DEPS_CORE_CHECKSUMS_DIR}}/{{.LIB_NAME}}.md5"
525-
FILE_SHA256: "65990dc2bcc4a355c2181bfe31a7800f492309d1bcd340f52a34e85047e61bc8"
526-
OUTPUT_DIR: "{{.YSTDLIB_OUTPUT_DIR}}"
527-
URL: "https://github.com/y-scope/ystdlib-cpp/archive/9ed78cd.tar.gz"
528-
- >-
529-
echo "set(
530-
CLP_YSTDLIB_SOURCE_DIRECTORY \"{{.YSTDLIB_OUTPUT_DIR}}\"
531-
)" > "{{.G_DEPS_CORE_CMAKE_SETTINGS_DIR}}/{{.LIB_NAME}}.cmake"
523+
CMAKE_GEN_ARGS:
524+
- "-C {{.G_DEPS_CORE_CMAKE_SETTINGS_DIR}}/{{.G_BOOST_LIB_NAME}}.cmake"
525+
- "-C {{.G_DEPS_CORE_CMAKE_SETTINGS_DIR}}/{{.G_CATCH2_LIB_NAME}}.cmake"
526+
- "-Dystdlib_BUILD_TESTING=OFF"
527+
LIB_NAME: "ystdlib"
528+
TARBALL_SHA256: "65990dc2bcc4a355c2181bfe31a7800f492309d1bcd340f52a34e85047e61bc8"
529+
TARBALL_URL: "https://github.com/y-scope/ystdlib-cpp/archive/9ed78cd.tar.gz"
532530

533531
zlib:
534532
internal: true

0 commit comments

Comments
 (0)