Skip to content

Commit 2cd3f84

Browse files
committed
Add comprehensive Windows build debugging and error handling
CMakeLists.txt: - Enable all ExternalProject logging flags - Add BUILD_ALWAYS to force rebuild and capture all output - Add Windows-specific verification commands for libatari800.a GitHub Actions: - Add MSBuild diagnostic verbosity and detailed logging - Add fallback logic to continue build if libatari800 exists despite errors - Add comprehensive error checking and library verification Should provide detailed insight into the MSBuild integration issue
1 parent feca1ad commit 2cd3f84

File tree

2 files changed

+50
-2
lines changed

2 files changed

+50
-2
lines changed

.github/workflows/build-windows.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,32 @@ jobs:
8383
-DFUJISAN_VERSION="${{ github.event.inputs.version || 'dev' }}" `
8484
..
8585
86-
- name: Build Fujisan
86+
- name: Build Fujisan
8787
run: |
8888
cd build-release
89-
cmake --build . --config Release --parallel 4
89+
echo "=== Building with enhanced MSBuild diagnostics ==="
90+
echo "MSBuild version:"
91+
msbuild -version
92+
echo "=== Starting build with detailed logging ==="
93+
94+
# Try build with detailed diagnostics
95+
if (-not (cmake --build . --config Release --parallel 4 --verbose -- /verbosity:diagnostic /consoleloggerparameters:ShowTimestamp)) {
96+
echo "=== First build attempt failed, checking atari800 status ==="
97+
98+
# Check if libatari800 was actually built despite the error
99+
if (Test-Path "atari800-src\src\libatari800.a") {
100+
echo "SUCCESS: libatari800.a exists despite build error!"
101+
Get-ChildItem "atari800-src\src\libatari800.a" | Format-List
102+
103+
echo "=== Attempting to continue with Fujisan build only ==="
104+
cmake --build . --config Release --target Fujisan --parallel 4 --verbose
105+
} else {
106+
echo "ERROR: libatari800.a was not created"
107+
echo "Contents of atari800-src/src/:"
108+
if (Test-Path "atari800-src\src") { Get-ChildItem "atari800-src\src" | Format-Table Name, Length }
109+
throw "Build failed - libatari800.a not found"
110+
}
111+
}
90112
91113
- name: Deploy Qt5 libraries
92114
run: |

CMakeLists.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,36 @@ ExternalProject_Add(atari800_external
9292
# No install step needed, we'll link directly to the library
9393
INSTALL_COMMAND ""
9494

95+
# Enhanced logging and debugging
96+
LOG_DOWNLOAD ON
97+
LOG_UPDATE ON
98+
LOG_PATCH ON
99+
LOG_CONFIGURE ON
100+
LOG_BUILD ON
101+
LOG_INSTALL ON
102+
LOG_MERGED_STDOUTERR ON
103+
LOG_OUTPUT_ON_FAILURE ON
104+
105+
# Force rebuild to ensure we see all output
106+
BUILD_ALWAYS ON
107+
95108
# Export the library location
96109
BUILD_BYPRODUCTS ${ATARI800_LIBRARY}
97110
)
98111

112+
# Verify that the library was created successfully
113+
if(WIN32)
114+
# Add custom command to verify library creation on Windows
115+
add_custom_command(TARGET atari800_external POST_BUILD
116+
COMMAND ${CMAKE_COMMAND} -E echo "=== Verifying libatari800 build on Windows ==="
117+
COMMAND ${CMAKE_COMMAND} -E echo "Expected library: ${ATARI800_LIBRARY}"
118+
COMMAND ${CMAKE_COMMAND} -E echo "Checking if library exists..."
119+
COMMAND ${CMAKE_COMMAND} -E echo "$<IF:$<BOOL:$<TARGET_EXISTS:${ATARI800_LIBRARY}>>,Library found,Library NOT found>"
120+
COMMAND ${MSYS2_BASH} -l -c "if [ -f '${ATARI800_LIBRARY}' ]; then echo 'SUCCESS: libatari800.a exists'; ls -la '${ATARI800_LIBRARY}'; else echo 'ERROR: libatari800.a missing'; ls -la '${ATARI800_SOURCE_DIR}/src/'; fi"
121+
COMMENT "Verifying libatari800 library creation"
122+
)
123+
endif()
124+
99125
# Create imported target for libatari800
100126
add_library(libatari800 STATIC IMPORTED)
101127
set_target_properties(libatari800 PROPERTIES

0 commit comments

Comments
 (0)