friendlyanon/setup-vcpkg

Issue with Windows builds

Closed this issue · 5 comments

toast
I've ran into the issue in #2, however even after fixing that I'm still running into an issue.

I don't see a committish being provided and there is no vcpkg submodule in your repo either (https://github.com/ToastWare/oftoast2-gdnative/tree/ci-windows).

I guess the better question here is how did the action succeed?

I think it succeeded due to this line being optional instead of required.
I'll add a committish now.

OK, added the commitish and now it just recurses untill it hits the recursion depth(?)
I assume I've probably misconfigured something:
toast

I took a look at the project's CML file and it's committing almost all sins that should not be committed in CMake. Its contents should be like so:

cmake_minimum_required(VERSION 3.18)

project(gddl C)

add_library(gddl src/gddl.c)

target_include_directories(gddl PRIVATE src)

find_path(GODOT_HEADERS_INCLUDE_DIR gdnative_api_struct.gen.h REQUIRED)
target_include_directories(gddl SYSTEM PRIVATE "${GODOT_HEADERS_INCLUDE_DIR}")

find_package(CURL REQUIRED)
find_package(zip REQUIRED)
target_link_libraries(gddl PRIVATE CURL::libcurl zip::zip)

Build and install the zip library somewhere before this and provide its install prefix via CMAKE_PREFIX_PATH. Set the GODOT_HEADERS_INCLUDE_DIR cache variable to the location where the godot headers are checked out. Then your build step in CI should be:

- shell: bash
  run: |
    cmake -S zip -B zip/build -DBUILD_SHARED_LIBS=0
    cmake --build zip/build --config Release
    cmake --install zip/build --config Release --prefix zip-prefix

    cmake -B build -DBUILD_SHARED_LIBS=1 "-DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" -DCMAKE_PREFIX_PATH=zip-prefix -DGODOT_HEADERS_INCLUDE_DIR=godot-headers
    cmake --build zip/build --config Release

But it looks like you aren't even using vcpkg, since there is no vcpkg.json file in the repo.

I thought I could just use vcpkg to get the curl library quickly; it appears I was mistaken. Closing.