mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-07-31 12:38:58 +00:00
windows: vendor GameInput headers
This commit is contained in:
committed by
Anonymous Maarten
parent
331e10c2a3
commit
b048e8e6f8
@@ -1200,7 +1200,7 @@ class Releaser:
|
||||
shutil.rmtree(deps_path, ignore_errors=True)
|
||||
dep_roots = []
|
||||
dep_includes = []
|
||||
for dep in self.release_info.get("dependencies"):
|
||||
for dep in self.release_info.get("dependencies", []):
|
||||
if "command" in self.release_info["dependencies"][dep]:
|
||||
dep_includes.append(self.deps_path / dep / "include")
|
||||
continue
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import argparse
|
||||
import logging
|
||||
from pathlib import Path
|
||||
import urllib.request
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
DEFAULT_GAMEINPUT_VERSION = "v3.3.195.0"
|
||||
|
||||
def download_sdk(tag: str, lowercase: bool, output: Path):
|
||||
base_url = f"https://raw.githubusercontent.com/microsoftconnect/GameInput/refs/tags/{tag}/"
|
||||
url_relpaths = (
|
||||
"include/GameInput.h",
|
||||
"include/v0/GameInput.h",
|
||||
"include/v1/GameInput.h",
|
||||
"include/v2/GameInput.h",
|
||||
"lib/arm64/GameInput.lib",
|
||||
"lib/x64/GameInput.lib",
|
||||
)
|
||||
for url_relpath in url_relpaths:
|
||||
url = base_url + url_relpath
|
||||
local_relpath = url_relpath
|
||||
if lowercase:
|
||||
local_relpath = local_relpath.lower()
|
||||
local_path = output / local_relpath
|
||||
|
||||
local_dirpath = local_path.parent
|
||||
local_dirpath.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
logger.info("Downloading %s to %s...", url, local_path)
|
||||
urllib.request.urlretrieve(url, local_path)
|
||||
logger.info("... done")
|
||||
|
||||
def main():
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
|
||||
parser = argparse.ArgumentParser(description="Download Microsoft.GameInput SDK", allow_abbrev=False)
|
||||
parser.add_argument("--version", help="GameInput release tag (see https://github.com/microsoftconnect/GameInput/tags)", default=DEFAULT_GAMEINPUT_VERSION)
|
||||
parser.add_argument("--no-lowercase", action="store_false", dest="lowercase", help="Don't lowercase downloaded files")
|
||||
parser.add_argument("-o", "--output", type=Path, default=Path.cwd(), help="SDK will be stored here (in include and lib subdirectories)")
|
||||
args = parser.parse_args()
|
||||
download_sdk(tag=args.version, lowercase=args.lowercase, output=args.output)
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
@@ -1,12 +1,6 @@
|
||||
{
|
||||
"name": "SDL3",
|
||||
"remote": "libsdl-org/SDL",
|
||||
"dependencies": {
|
||||
"gameinput": {
|
||||
"command": "build-scripts/download-gameinput-sdk.py -o @<@DEPS_PATH@>@",
|
||||
"artifact": "gameinput/include/gameinput.h"
|
||||
}
|
||||
},
|
||||
"version": {
|
||||
"file": "include/SDL3/SDL_version.h",
|
||||
"re_major": "^#define SDL_MAJOR_VERSION\\s+([0-9]+)$",
|
||||
@@ -60,9 +54,6 @@
|
||||
"build-scripts/pkg-support/mingw/cmake/SDL3Config.cmake",
|
||||
"build-scripts/pkg-support/mingw/cmake/SDL3ConfigVersion.cmake"
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"gameinput": {}
|
||||
}
|
||||
},
|
||||
"msvc": {
|
||||
@@ -138,9 +129,6 @@
|
||||
"include/SDL3": [
|
||||
"include/SDL3/*.h"
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"gameinput": {}
|
||||
}
|
||||
},
|
||||
"android": {
|
||||
|
||||
Reference in New Issue
Block a user