From d2e30d2167daa3623076f9de642713816a825f8a Mon Sep 17 00:00:00 2001 From: hwsmm <9151706+hwsmm@users.noreply.github.com> Date: Thu, 2 Jan 2025 00:51:58 +0900 Subject: [PATCH] Patch SDL to not include gameinput.h --- External/build.sh | 6 ++++++ External/exclude-gameinput.patch | 10 ++++++++++ 2 files changed, 16 insertions(+) create mode 100644 External/exclude-gameinput.patch diff --git a/External/build.sh b/External/build.sh index 9a715ed..c1d5481 100755 --- a/External/build.sh +++ b/External/build.sh @@ -88,6 +88,12 @@ fi # Build SDL pushd SDL >/dev/null git reset --hard HEAD + +if [[ $RUNNER_OS == 'Windows' ]]; then + echo "Patching SDL to not include gameinput.h" + patch -Np1 -i ../exclude-gameinput.patch +fi + cmake -B build $FLAGS -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSDL_SHARED_ENABLED_BY_DEFAULT=ON -DSDL_STATIC_ENABLED_BY_DEFAULT=ON cmake --build build/ --config Release $SUDO cmake --install build/ --prefix install_output --config Release diff --git a/External/exclude-gameinput.patch b/External/exclude-gameinput.patch new file mode 100644 index 0000000..c85c42f --- /dev/null +++ b/External/exclude-gameinput.patch @@ -0,0 +1,10 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1953,6 +1953,7 @@ elseif(WINDOWS) + check_c_source_compiles(" + #include + #define COBJMACROS ++ #error SDL does not build on Github Actions with GameInput + #include + int main(int argc, char **argv) { return 0; }" HAVE_GAMEINPUT_H + )