Skip to content

Commit 3030a85

Browse files
committed
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! squash! fixup! Fix CI regressions
1 parent f222a28 commit 3030a85

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

build_sdl.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,14 @@ def get_cdef() -> tuple[str, dict[str, str]]:
301301
parser = SDLParser()
302302
parser.add_path(temp_dir)
303303
parser.add_path(SDL_INCLUDE)
304+
if Path(SDL_INCLUDE / "SDL3/SDL.h").exists(): # Regular path
305+
sdl3_header = "SDL3/SDL.h"
306+
elif Path(SDL_INCLUDE / "SDL.h").exists(): # Using MacOS dmg archive
307+
sdl3_header = "SDL.h"
308+
else:
309+
raise AssertionError(SDL_INCLUDE)
304310
parser.parse(
305-
"""
311+
f"""
306312
// Remove extern keyword.
307313
#define extern
308314
// Ignore some SDL assert statements.
@@ -314,14 +320,9 @@ def get_cdef() -> tuple[str, dict[str, str]]:
314320
315321
#define SDL_oldnames_h_
316322
323+
#include <{sdl3_header}>
317324
"""
318325
)
319-
if Path(SDL_INCLUDE, "SDL3/SDL.h").exists(): # Regular path
320-
parser.parse("#include <SDL3/SDL.h>\n")
321-
elif Path(SDL_INCLUDE, "SDL.h").exists(): # Using MacOS dmg archive
322-
parser.parse("#include <SDL.h>\n")
323-
else:
324-
raise AssertionError(SDL_INCLUDE)
325326
sdl_cdef = parser.get_output()
326327

327328
sdl_cdef = RE_VAFUNC.sub("", sdl_cdef)

0 commit comments

Comments
 (0)