Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
719e65b
Add depdency install through taskfile
sitaowang1998 Apr 15, 2025
a1a829c
Remove catch2 submodule
sitaowang1998 Apr 15, 2025
ed93185
Update cmake to use dependencies installed through tasks
sitaowang1998 Apr 15, 2025
c03700d
Add dep_install in lib_install to satisfy GH workflow
sitaowang1998 Apr 15, 2025
c7de69c
Add abseil in deps tasks
sitaowang1998 Apr 15, 2025
ad3a40a
Remove abseil from submodule and submodules directory
sitaowang1998 Apr 15, 2025
1d7d607
Rename abseil lib name
sitaowang1998 Apr 15, 2025
cff7ade
Update cmake for abseil installed by tasks
sitaowang1998 Apr 15, 2025
b94aff5
Add PIC in dependency
sitaowang1998 Apr 15, 2025
0c592b5
Update setup in README
sitaowang1998 Apr 17, 2025
e440753
Add task to download ystdlib source
sitaowang1998 Apr 15, 2025
d22fab8
Add ystdlib-cpp in cmake
sitaowang1998 Apr 15, 2025
464dee8
Update clang format with ystdlib library
sitaowang1998 Apr 16, 2025
32f4cdf
Remove unused git submodule file
sitaowang1998 Apr 21, 2025
57a813c
Remove sumodule checkout in GH workflows
sitaowang1998 Apr 21, 2025
5d03504
Revert "Remove sumodule checkout in GH workflows"
sitaowang1998 Apr 21, 2025
54f45d3
Revert "Remove unused git submodule file"
sitaowang1998 Apr 21, 2025
da30d3d
Fix clang tidy task for example code
sitaowang1998 Apr 21, 2025
c28ed52
Update yscope-dev-utils version for install deps and generate settings
sitaowang1998 Apr 21, 2025
1c78960
Use cmake install-deps-and-generate-settings to install dependencies
sitaowang1998 Apr 21, 2025
a47cb8f
Fix clang tidy for global variable
sitaowang1998 Apr 21, 2025
e4761d2
Use heredoc for instead of echo
sitaowang1998 Apr 22, 2025
169e0a7
fix clang tidy for global variable
sitaowang1998 Apr 22, 2025
03a14ee
Fix heredoc indentation
sitaowang1998 Apr 22, 2025
400a56d
Remove unnecessary global variables
sitaowang1998 Apr 22, 2025
bfd54d5
Add top level project check around including dependencies
sitaowang1998 Apr 22, 2025
69d106e
Improve example cmake by using absolute path
sitaowang1998 Apr 22, 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
6 changes: 0 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
[submodule "tools/yscope-dev-utils"]
path = tools/yscope-dev-utils
url = https://github.com/y-scope/yscope-dev-utils.git
[submodule "submodules/Catch2"]
path = submodules/Catch2
url = https://github.com/catchorg/Catch2.git
[submodule "submodules/abseil-cpp"]
path = submodules/abseil-cpp
url = https://github.com/abseil/abseil-cpp.git
29 changes: 24 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,31 @@ else()
message(FATAL_ERROR "Could not find msgpack-cxx")
endif()

# Add abseil-cpp
set(ABSL_PROPAGATE_CXX_STD ON)
add_subdirectory(submodules/abseil-cpp)
# Include dependency settings.
include("build/deps/cmake-settings/settings.cmake")

find_package(outcome REQUIRED)
if(outcome_FOUND)
message(STATUS "Found outcome.")
else()
message(FATAL_ERROR "Could not find libraries for outcome.")
endif()

find_package(Catch2 3.8.0 REQUIRED)
if(Catch2_FOUND)
message(STATUS "Found Catch2 ${Catch2_VERSION}.")
else()
message(FATAL_ERROR "Could not find libraries for Catch2.")
endif()
Comment thread
davidlion marked this conversation as resolved.

# Add catch2
add_subdirectory(submodules/Catch2)
# Add abseil
set(ABSL_PROPAGATE_CXX_STD ON)
find_package(absl REQUIRED)
if(absl_FOUND)
message(STATUS "Found abseil ${absl_VERSION}.")
else()
message(FATAL_ERROR "Could not find libraries for abseil.")
endif()

find_package(Threads REQUIRED)

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ Follow the steps below to develop and contribute to the project.
* [Task] 3.40.0 or higher

## Set up
Initialize and update submodules:
Run dependency installation task:
```shell
git submodule update --init --recursive
task deps:dep_install
```

Set up the config files for our C++ linting tools:
Expand Down
131 changes: 131 additions & 0 deletions dep-tasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ version: "3"
vars:
G_SCRIPT_DIR: "{{.ROOT_DIR}}/tools/scripts"

G_ABSEIL_LIB_NAME: "absl"
G_ABSEIL_WORK_DIR: "{{.G_DEPS_DIR}}/{{.G_ABSEIL_LIB_NAME}}"
G_CATCH2_LIB_NAME: "Catch2"
G_CATCH2_WORK_DIR: "{{.G_DEPS_DIR}}/{{.G_CATCH2_LIB_NAME}}"
G_OUTCOME_LIB_NAME: "outcome"
G_OUTCOME_WORK_DIR: "{{.G_DEPS_DIR}}/{{.G_OUTCOME_LIB_NAME}}"
G_QUICKCPPLIB_LIB_NAME: "quickcpplib"
G_QUICKCPPLIB_WORK_DIR: "{{.G_DEPS_DIR}}/{{.G_QUICKCPPLIB_LIB_NAME}}"

tasks:

lib_install:
Expand All @@ -14,10 +23,132 @@ tasks:
dir: "{{.G_SCRIPT_DIR}}/lib_install/macOS"
cmds:
- "./install-lib.sh"
- task: "dep_install"

lib_install_linux:
internal: true
platforms: ["linux"]
dir: "{{.G_SCRIPT_DIR}}/lib_install/linux"
cmds:
- "./install-lib.sh"
- task: "dep_install"

dep_install:
cmds:
- task: "install-all-init"
- task: "install-all-run"
- task: "install-all-finish"

install-all-init:
internal: true
cmds:
- "rm -rf {{.G_DEPS_CMAKE_SETTINGS_DIR}}"
- "mkdir -p {{.G_DEPS_CMAKE_SETTINGS_DIR}}"

install-all-run:
internal: true
deps:
- task: "install-abseil"
- task: "install-Catch2"
- task: "install-outcome"

install-all-finish:
internal: true
cmds:
- >-
for file in {{.G_DEPS_CMAKE_SETTINGS_DIR}}/*.cmake; do
if [ "$file" != "{{.G_DEPS_CMAKE_SETTINGS_FILE}}" ]; then
echo "include(\"$file\")" >> "{{.G_DEPS_CMAKE_SETTINGS_FILE}}";
fi
done

add-package-root-to-cmake-settings:
internal: true
requires:
vars:
- "NAME"
- "INSTALL_PREFIX"
cmds:
- >-
echo "set(
{{.NAME}}_ROOT
\"{{.INSTALL_PREFIX}}\"
CACHE PATH
\"Path to {{.NAME}} settings\"
)" >> "{{.G_DEPS_CMAKE_SETTINGS_DIR}}/{{.NAME}}.cmake"

Comment thread
sitaowang1998 marked this conversation as resolved.
Outdated
install-abseil:
internal: true
run: "once"
cmds:
- task: ":utils:cmake:install-remote-tar"
vars:
NAME: "{{.G_ABSEIL_LIB_NAME}}"
WORK_DIR: "{{.G_ABSEIL_WORK_DIR}}"
FILE_SHA256: "b396401fd29e2e679cace77867481d388c807671dc2acc602a0259eeb79b7811"
URL: "https://github.com/abseil/abseil-cpp/archive/refs/tags/20250127.1.tar.gz"
GEN_ARGS:
- "-DCMAKE_POSITION_INDEPENDENT_CODE=ON"
- task: "add-package-root-to-cmake-settings"
vars:
NAME: "{{.G_ABSEIL_LIB_NAME}}"
INSTALL_PREFIX: "{{.G_ABSEIL_WORK_DIR}}/{{.G_ABSEIL_LIB_NAME}}-install"

install-Catch2:
internal: true
run: "once"
cmds:
- task: ":utils:cmake:install-remote-tar"
vars:
NAME: "{{.G_CATCH2_LIB_NAME}}"
WORK_DIR: "{{.G_CATCH2_WORK_DIR}}"
FILE_SHA256: "1ab2de20460d4641553addfdfe6acd4109d871d5531f8f519a52ea4926303087"
URL: "https://github.com/catchorg/Catch2/archive/refs/tags/v3.8.0.tar.gz"
GEN_ARGS:
- "-DCMAKE_POSITION_INDEPENDENT_CODE=ON"
- task: "add-package-root-to-cmake-settings"
vars:
NAME: "{{.G_CATCH2_LIB_NAME}}"
INSTALL_PREFIX: "{{.G_CATCH2_WORK_DIR}}/{{.G_CATCH2_LIB_NAME}}-install"

install-outcome:
internal: true
run: "once"
deps:
- "install-quickcpplib"
cmds:
- task: ":utils:cmake:install-remote-tar"
vars:
NAME: "{{.G_OUTCOME_LIB_NAME}}"
WORK_DIR: "{{.G_OUTCOME_WORK_DIR}}"
FILE_SHA256: "0382248cbb00806ce4b5f3ce6939797dc3b597c85fd3531614959e31ef488b39"
URL: "https://github.com/ned14/outcome/archive/refs/tags/v2.2.11.tar.gz"
GEN_ARGS:
- "-C {{.G_DEPS_CMAKE_SETTINGS_DIR}}/{{.G_QUICKCPPLIB_LIB_NAME}}.cmake"
- "-DBUILD_TESTING=OFF"
- "-DCMAKE_BUILD_TYPE=Release"
- "-DCMAKE_POLICY_DEFAULT_CMP0074=NEW"
- "-DCMAKE_POSITION_INDEPENDENT_CODE=ON"
- task: "add-package-root-to-cmake-settings"
vars:
NAME: "{{.G_OUTCOME_LIB_NAME}}"
INSTALL_PREFIX: "{{.G_OUTCOME_WORK_DIR}}/{{.G_OUTCOME_LIB_NAME}}-install"

install-quickcpplib:
internal: true
run: "once"
cmds:
- task: ":utils:cmake:install-remote-tar"
vars:
NAME: "{{.G_QUICKCPPLIB_LIB_NAME}}"
WORK_DIR: "{{.G_QUICKCPPLIB_WORK_DIR}}"
FILE_SHA256: "5d4c9b2d6fa177d3fb14f3fe3086867e43b44f4a7a944eb10ee4616b2b0f3c05"
URL: "https://github.com/ned14/quickcpplib/archive/f3e452e.tar.gz"
GEN_ARGS:
- "-DBUILD_TESTING=OFF"
- "-DCMAKE_BUILD_TYPE=Release"
- "-DCMAKE_POSITION_INDEPENDENT_CODE=ON"
- task: "add-package-root-to-cmake-settings"
vars:
NAME: "{{.G_QUICKCPPLIB_LIB_NAME}}"
INSTALL_PREFIX: "{{.G_QUICKCPPLIB_WORK_DIR}}/{{.G_QUICKCPPLIB_LIB_NAME}}-install"
1 change: 0 additions & 1 deletion submodules/Catch2
Submodule Catch2 deleted from a6ee7e
1 change: 0 additions & 1 deletion submodules/abseil-cpp
Submodule abseil-cpp deleted from 07fff7
5 changes: 5 additions & 0 deletions taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ vars:
G_TEST_DIR: "{{.ROOT_DIR}}/tests"
G_EXAMPLES_DIR: "{{.ROOT_DIR}}/examples"

G_DEPS_DIR: "{{.G_BUILD_DIR}}/deps"
# These should be kept in-sync with its usage in CMakeLists.txt
G_DEPS_CMAKE_SETTINGS_DIR: "{{.G_DEPS_DIR}}/cmake-settings"
G_DEPS_CMAKE_SETTINGS_FILE: "{{.G_DEPS_CMAKE_SETTINGS_DIR}}/settings.cmake"

tasks:
clean:
cmds:
Expand Down