From 8132405bab98001fe028fdfe304b16c68086c9a8 Mon Sep 17 00:00:00 2001 From: Nikita <69168929+nikitalita@users.noreply.github.com> Date: Tue, 24 Jun 2025 09:50:46 -0700 Subject: 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 --- .github/workflows/macos-compile.yml | 8 ++++++-- .github/workflows/main.yml | 8 ++++++-- .gitignore | 3 ++- CMakeLists.txt | 4 +--- vcpkg.json | 23 +++++++++++++++++++++++ 5 files changed, 38 insertions(+), 8 deletions(-) create mode 100644 vcpkg.json 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 - "$<$: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 - "$<$: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 $,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": [] +} -- cgit v1.2.3