Skip to content

Commit d4f22da

Browse files
committed
try finding generated headers elswhere?
1 parent 61643f4 commit d4f22da

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

tools/build_sdl_windows.ps1

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,39 @@ Copy-Item -Path "$BUILD_DIR/$RELEASE_BUILD/SDL2main.lib" -Destination "$INSTALL_
7474
Remove-Item -Path "$INSTALL_DIR/include/SDL2" -Recurse -Force -ErrorAction SilentlyContinue
7575
New-Item -ItemType Directory -Force -Path "$INSTALL_DIR/include/SDL2" | Out-Null
7676
Copy-Item -Path "$EXTRACT_DIR_ABS/include/*" -Destination "$INSTALL_DIR/include/SDL2/" -Recurse -Force
77-
Copy-Item -Path "$BUILD_DIR/$RELEASE_BUILD/SDL_config.h" -Destination "$INSTALL_DIR/include/SDL2/SDL_config.h" -Force
77+
78+
# Find and copy SDL_config.h (generated during build, location varies)
79+
$CONFIG_H = $null
80+
Write-Host "Looking for SDL_config.h..."
81+
Write-Host " Checking: $BUILD_DIR/$RELEASE_BUILD/SDL_config.h"
82+
Write-Host " Checking: $BUILD_DIR/SDL_config.h"
83+
Write-Host " Checking: $EXTRACT_DIR_ABS/include/SDL_config.h"
84+
85+
# Try common CMake-generated locations
86+
$CANDIDATES = @(
87+
"$BUILD_DIR/$RELEASE_BUILD/SDL_config.h",
88+
"$BUILD_DIR/SDL_config.h",
89+
"$BUILD_DIR/include/SDL_config.h",
90+
"$EXTRACT_DIR_ABS/include/SDL_config.h"
91+
)
92+
93+
foreach ($candidate in $CANDIDATES) {
94+
if (Test-Path $candidate) {
95+
Write-Host " Found at: $candidate"
96+
$CONFIG_H = $candidate
97+
break
98+
}
99+
}
100+
101+
if ($CONFIG_H) {
102+
Copy-Item -Path $CONFIG_H -Destination "$INSTALL_DIR/include/SDL2/SDL_config.h" -Force
103+
Write-Host "SDL_config.h copied from $CONFIG_H"
104+
} else {
105+
Write-Host "SDL_config.h not found. Searching build directory..."
106+
Get-ChildItem -Path $BUILD_DIR -Filter "SDL_config.h" -Recurse | ForEach-Object {
107+
Write-Host " Found: $($_.FullName)"
108+
}
109+
}
78110

79111
Write-Host "SDL ${SDL_VERSION} built and installed into ${INSTALL_DIR}"
80112
Pop-Location

0 commit comments

Comments
 (0)