Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update vcpkg configuration and boost dependencies #36

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 10 additions & 3 deletions .github/workflows/vcpkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ jobs:
!${{github.workspace}}/vcpkg/buildtrees
!${{github.workspace}}/vcpkg/packages
!${{github.workspace}}/vcpkg/downloads
${{ github.workspace }}/build/vcpkg_installed
${{ github.workspace }}/build/bin/Db*.solutions
key: ${{ runner.os }}-vcpkg-${{ hashFiles('**/vcpkg.json') }}
key: ${{ runner.os }}-vcpkg-${{ hashFiles('**/vcpkg.json', '**/vcpkg-configuration.json') }}-v1
restore-keys: |
${{ runner.os }}-vcpkg-${{ hashFiles('**/vcpkg.json', '**/vcpkg-configuration.json') }}-
${{ runner.os }}-vcpkg-

- name: Install dependencies (Ubuntu)
Expand Down Expand Up @@ -62,10 +64,15 @@ jobs:
vcpkgJsonGlob: '**/vcpkg.json'

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -G Ninja -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/vcpkg/scripts/buildsystems/vcpkg.cmake -DOPENMIND_BUILD_TESTS=OFF || cmake -B ${{github.workspace}}/build -G Ninja -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/vcpkg/scripts/buildsystems/vcpkg.cmake -DOPENMIND_BUILD_TESTS=OFF
run: |
cmake -B ${{github.workspace}}/build -G Ninja \
-DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DOPENMIND_BUILD_TESTS=ON \
-DOPENMIND_USE_VCPKG=ON \
-DCMAKE_BUILD_TYPE=Release

- name: Build
run: cmake --build ${{github.workspace}}/build
run: cmake --build ${{github.workspace}}/build --config Release -j$(nproc)

- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v2
Expand Down
14 changes: 12 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
cmake_minimum_required (VERSION 3.8)
cmake_minimum_required (VERSION 3.8)

project(skrypt)

set(OPENMIND_USE_VCPKG ON)

enable_language(CXX)
set (CMAKE_CXX_STANDARD 23)
Expand Down Expand Up @@ -33,7 +37,13 @@ include(FetchContent)
FetchContent_Declare(openmind
GIT_REPOSITORY https://github.com/ohhmm/openmind.git
GIT_TAG main)
FetchContent_MakeAvailable(openmind)
FetchContent_MakeAvailable(openmind)

# Add openmind's cmake modules to the module path
list(APPEND CMAKE_MODULE_PATH
"${CMAKE_BINARY_DIR}/_deps/openmind-src/cmake"
"${CMAKE_BINARY_DIR}/_deps/openmind-src/cmake/Modules"
)

if(BUILD_TESTS OR OPENMIND_BUILD_TESTS)
enable_testing()
Expand Down
5 changes: 3 additions & 2 deletions libskrypt/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@

set(deplist math)

# Using Boost components from openmind
set(deplist ${deplist} Boost::filesystem Boost::program_options)

if(TARGET Boost::dll)
set(deplist ${deplist} Boost::dll)
elseif(Boost_DLL_LIBRARY)
set(deplist ${deplist} ${Boost_DLL_LIBRARY})
else()
set(deplist ${deplist} boost)
endif()

lib(${deplist})
7 changes: 6 additions & 1 deletion libskrypt/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@

test()
# Configure test dependencies
set(TEST_DEPS libskrypt)
set(BOOST_TEST_LINK_LIBS Boost::unit_test_framework)

# Configure tests with dependencies
test("${TEST_DEPS}")
1 change: 0 additions & 1 deletion skrypt/skrypt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ using namespace omnn::math;
#include <boost/serialization/vector.hpp>
#include <boost/program_options.hpp>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/lambda2.hpp>
#include <boost/filesystem/path.hpp>
#include <boost/archive/binary_oarchive.hpp>

Expand Down
20 changes: 10 additions & 10 deletions vcpkg-configuration.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"default-registry": {
"kind": "git",
"baseline": "3508985146f1b1d248c67ead13f8f54be5b4f5da",
"repository": "https://github.com/ohhmm/vcpkg",
"reference": "openmind-port",
"packages": [
"openmind"
]
}
}
"registries": [
{
"kind": "git",
"repository": "https://github.com/ohhmm/vcpkg",
"baseline": "3508985146f1b1d248c67ead13f8f54be5b4f5da",
"reference": "openmind-port",
"packages": ["openmind"]
}
]
}
7 changes: 5 additions & 2 deletions vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
{
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
"builtin-baseline": "3508985146f1b1d248c67ead13f8f54be5b4f5da",
"builtin-baseline": "a8954b904ad2a6939ecd8fc213e87702fa1243ea",
"name": "skrypt",
"version": "1.0.0",
"description": "Sergii Kryvonos Relation Yarn Plausibility Tool",
"dependencies": [
"boost",
"boost-chrono",
"boost-compute",
"boost-date-time",
"boost-dll",
"boost-filesystem",
"boost-gil",
"boost-iostreams",
"boost-lambda",
"boost-locale",
"boost-multiprecision",
"boost-ublas",
"boost-program-options",
"boost-serialization",
"boost-system",
"boost-test",
"boost-thread",
"boost-uuid",
"leveldb",
"tbb",
{
"name": "vcpkg-cmake",
"host": true
Expand Down
Loading