@@ -74,7 +74,39 @@ Copy-Item -Path "$BUILD_DIR/$RELEASE_BUILD/SDL2main.lib" -Destination "$INSTALL_
7474Remove-Item - Path " $INSTALL_DIR /include/SDL2" - Recurse - Force - ErrorAction SilentlyContinue
7575New-Item - ItemType Directory - Force - Path " $INSTALL_DIR /include/SDL2" | Out-Null
7676Copy-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
79111Write-Host " SDL ${SDL_VERSION} built and installed into ${INSTALL_DIR} "
80112Pop-Location
0 commit comments