Skip to content

Commit

Permalink
Use vcpkg to find Catch2
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisThrasher committed Sep 30, 2024
1 parent 14b4d50 commit 19a0a74
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 25 deletions.
21 changes: 20 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
- { name: Windows Clang, os: windows-latest, flags: -GNinja -DCMAKE_CXX_COMPILER=clang++ }
- { name: Linux GCC, os: ubuntu-latest }
- { name: Linux Clang, os: ubuntu-latest, flags: -DCMAKE_CXX_COMPILER=clang++ }
- { name: macOS GCC, os: macos-latest, flags: -DCMAKE_CXX_COMPILER=g++-12 }
- { name: macOS Clang, os: macos-latest, flags: -GXcode }
type:
- { name: Shared, flags: "ON" }
Expand All @@ -41,6 +40,11 @@ jobs:

- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- name: Install Vcpkg
run: ./cmake/vcpkg/bootstrap-vcpkg.sh

- name: Configure
run: cmake --preset dev ${{matrix.platform.flags}} -DBUILD_SHARED_LIBS=${{matrix.type.flags}} -DCMAKE_BUILD_TYPE=${{matrix.config.name}} -DCMAKE_VERBOSE_MAKEFILE=ON
Expand All @@ -58,6 +62,11 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- name: Install Vcpkg
run: ./cmake/vcpkg/bootstrap-vcpkg.sh

- name: Configure
run: cmake --preset coverage
Expand Down Expand Up @@ -103,6 +112,11 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- name: Install Vcpkg
run: ./cmake/vcpkg/bootstrap-vcpkg.sh

- name: Configure
run: cmake --preset dev -DCMAKE_CXX_COMPILER=clang++
Expand All @@ -117,6 +131,11 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- name: Install Vcpkg
run: ./cmake/vcpkg/bootstrap-vcpkg.sh

- name: Configure
run: cmake --preset sanitizers
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "vcpkg"]
path = cmake/vcpkg
url = git@github.com:Microsoft/vcpkg.git
10 changes: 1 addition & 9 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"name": "dev",
"binaryDir": "build",
"installDir": "build/install",
"toolchainFile": "cmake/vcpkg/scripts/buildsystems/vcpkg.cmake",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_CXX_EXTENSIONS": "OFF",
Expand All @@ -13,15 +14,6 @@
"ARGON_ENABLE_WARNINGS": "ON",
"ARGON_BUILD_TESTING": "ON",
"ARGON_BUILD_EXAMPLES": "ON"
},
"warnings": {
"dev": true,
"deprecated": true,
"uninitialized": true
},
"errors": {
"dev": true,
"deprecated": true
}
},
{
Expand Down
1 change: 1 addition & 0 deletions cmake/vcpkg
Submodule vcpkg added at 350898
4 changes: 1 addition & 3 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})

find_package(Catch2 3.6.0 REQUIRED)
find_package(Catch2 3.7.0 REQUIRED)
include(Catch)

add_executable(test-argon Main.cpp Argument.cpp Option.cpp Parser.cpp Position.cpp)
Expand Down
12 changes: 0 additions & 12 deletions tests/FindCatch2.cmake

This file was deleted.

7 changes: 7 additions & 0 deletions vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "argon",
"version-string": "0.12.0",
"dependencies": [
"catch2"
]
}

0 comments on commit 19a0a74

Please sign in to comment.