summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita <69168929+nikitalita@users.noreply.github.com>2025-06-24 09:50:46 -0700
committerGitHub <noreply@github.com>2025-06-24 10:50:46 -0600
commit8132405bab98001fe028fdfe304b16c68086c9a8 (patch)
tree81e3c01899ab3aa7cd874c3268bc13138811cbfe
parent9e1543d434589fc3255b9ba45dbf838406f55cc4 (diff)
Add vcpkg.json, change MacOS CI to use that (#346)
* add vcpkg support for installing dependencies * Change macos CI to use vcpkg for dependencies * actually fix CI for macos * fix SDL_net linking SDL_net was being linked twice * update baseline
-rw-r--r--.github/workflows/macos-compile.yml8
-rw-r--r--.github/workflows/main.yml8
-rw-r--r--.gitignore3
-rw-r--r--CMakeLists.txt4
-rw-r--r--vcpkg.json23
5 files changed, 38 insertions, 8 deletions
diff --git a/.github/workflows/macos-compile.yml b/.github/workflows/macos-compile.yml
index 864209387..6d8780839 100644
--- a/.github/workflows/macos-compile.yml
+++ b/.github/workflows/macos-compile.yml
@@ -12,10 +12,14 @@ jobs:
with:
submodules: recursive
- name: Install dependencies
- run: brew install sdl2 libpng glew ninja cmake libzip nlohmann-json tinyxml2 spdlog vorbis-tools
+ run: brew install ninja cmake
+ - name: Install vcpkg
+ uses: lukka/run-vcpkg@v11.5
+ with:
+ vcpkgDirectory: '${{ github.workspace }}/vcpkg'
- name: Build
run: |
- cmake -H. -Bbuild-cmake -GNinja -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=Release
+ cmake -H. -Bbuild-cmake -GNinja -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake
cmake --build build-cmake -j
- name: Create Package
run: |
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 11b6682c1..0a0e10921 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -82,10 +82,14 @@ jobs:
with:
submodules: recursive
- name: Install dependencies
- run: brew install sdl2 sdl2_net libpng glew ninja cmake libzip nlohmann-json tinyxml2 spdlog vorbis-tools
+ run: brew install ninja cmake
+ - name: Install vcpkg
+ uses: lukka/run-vcpkg@v11.5
+ with:
+ vcpkgDirectory: '${{ github.workspace }}/vcpkg'
- name: Build
run: |
- cmake -H. -Bbuild-cmake -GNinja -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=Release
+ cmake -H. -Bbuild-cmake -GNinja -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake
cmake --build build-cmake --config Release -j3
- name: Download spaghetti.o2r
uses: actions/download-artifact@v4
diff --git a/.gitignore b/.gitignore
index 97b0f0f86..10252752d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -125,4 +125,5 @@ cmake-build-*/
.idea/
.vs
build*/
-.DS_Store \ No newline at end of file
+.DS_Store
+.cache/
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b5429241b..120d049bc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -393,7 +393,6 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
find_package(Vorbis CONFIG REQUIRED)
link_libraries(Vorbis::vorbisfile)
set(ADDITIONAL_LIBRARY_DEPENDENCIES
- "$<$<BOOL:${USE_NETWORKING}>:SDL2_net::SDL2_net-static>"
"Ogg::ogg"
"Vorbis::vorbis"
"Vorbis::vorbisenc"
@@ -416,7 +415,6 @@ else()
find_package(Ogg REQUIRED)
find_package(Vorbis REQUIRED)
set(ADDITIONAL_LIBRARY_DEPENDENCIES
- "$<$<BOOL:${USE_NETWORKING}>:SDL2_net::SDL2_net>"
"Ogg::ogg"
"Vorbis::vorbis"
"Vorbis::vorbisenc"
@@ -435,7 +433,7 @@ if(USE_NETWORKING)
target_link_libraries(${PROJECT_NAME} PRIVATE SDL2_net)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
find_package(SDL2_net REQUIRED)
- target_link_libraries(${PROJECT_NAME} PRIVATE SDL2_net::SDL2_net)
+ target_link_libraries(${PROJECT_NAME} PRIVATE $<IF:$<TARGET_EXISTS:SDL2_net::SDL2_net>,SDL2_net::SDL2_net,SDL2_net::SDL2_net-static>)
else()
find_package(SDL2_net REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE SDL2_net::SDL2_net-static)
diff --git a/vcpkg.json b/vcpkg.json
new file mode 100644
index 000000000..ef3450b2a
--- /dev/null
+++ b/vcpkg.json
@@ -0,0 +1,23 @@
+{
+ "name": "spaghettikart",
+ "version": "1.0.0",
+ "description": "A Mario Kart 64 port",
+ "homepage": "https://github.com/HarbourMasters/SpaghettiKart",
+ "dependencies": [
+ "zlib",
+ "bzip2",
+ "libzip",
+ "libpng",
+ "sdl2",
+ "sdl2-net",
+ "glew",
+ "glfw3",
+ "nlohmann-json",
+ "tinyxml2",
+ "spdlog",
+ "libogg",
+ "libvorbis"
+ ],
+ "builtin-baseline": "2e58bb35ff7a3a037920d959ce20cb4d8c22319a",
+ "overrides": []
+}