Skip to content

Commit 6bb4f46

Browse files
committed
Fix Windows build MSBuild integration issues
- Remove invalid CMake generator expressions from verification commands - Add MinGW gcc to PATH in MSYS2 environment for proper toolchain access - Enhance MSYS2 setup verification with detailed compiler detection - Fix PATH configuration in all MSYS2 build commands This resolves the two critical issues identified from GitHub Actions logs: 1. CMake configuration errors with TARGET_EXISTS on file paths 2. gcc not accessible in MSYS environment despite MinGW installation
1 parent 2cd3f84 commit 6bb4f46

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

.github/workflows/build-windows.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,22 @@ jobs:
6060
- name: Verify MSYS2 setup
6161
shell: msys2 {0}
6262
run: |
63+
# Add MinGW paths to ensure gcc is accessible
64+
export PATH="/mingw64/bin:$PATH"
65+
6366
# Verify MSYS2 tools are available
6467
echo "=== Checking MSYS2 Tools ==="
65-
which gcc && gcc --version | head -1
66-
which make && make --version | head -1
67-
which autoconf && autoconf --version | head -1
68-
which aclocal && aclocal --version | head -1
69-
which automake && automake --version | head -1
68+
echo "Current PATH: $PATH"
69+
which gcc && gcc --version | head -1 || echo "gcc not found in PATH"
70+
which make && make --version | head -1 || echo "make not found in PATH"
71+
which autoconf && autoconf --version | head -1 || echo "autoconf not found in PATH"
72+
which aclocal && aclocal --version | head -1 || echo "aclocal not found in PATH"
73+
which automake && automake --version | head -1 || echo "automake not found in PATH"
74+
75+
# List available compilers
76+
echo "=== Available GCC compilers ==="
77+
ls -la /mingw64/bin/gcc* 2>/dev/null || echo "No MinGW64 GCC found"
78+
ls -la /usr/bin/gcc* 2>/dev/null || echo "No MSYS GCC found"
7079
echo "=== MSYS2 Setup Complete ==="
7180
7281
- name: Create build directory

CMakeLists.txt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ if(WIN32)
6464

6565
message(STATUS "Found MSYS2 bash: ${MSYS2_BASH}")
6666

67-
# Use msys2 shell environment directly instead of bash -l -c
68-
set(ATARI800_CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env MSYSTEM=MSYS ${MSYS2_BASH} --login -c "cd '<SOURCE_DIR>' && '${CMAKE_CURRENT_SOURCE_DIR}/scripts/configure-atari800.sh' '<SOURCE_DIR>'")
69-
set(ATARI800_BUILD_COMMAND ${CMAKE_COMMAND} -E env MSYSTEM=MSYS ${MSYS2_BASH} --login -c "cd '<SOURCE_DIR>' && make -j4")
67+
# Use msys2 shell environment with proper PATH for MinGW gcc
68+
set(ATARI800_CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env MSYSTEM=MSYS ${MSYS2_BASH} --login -c "export PATH='/mingw64/bin:$PATH' && cd '<SOURCE_DIR>' && '${CMAKE_CURRENT_SOURCE_DIR}/scripts/configure-atari800.sh' '<SOURCE_DIR>'")
69+
set(ATARI800_BUILD_COMMAND ${CMAKE_COMMAND} -E env MSYSTEM=MSYS ${MSYS2_BASH} --login -c "export PATH='/mingw64/bin:$PATH' && cd '<SOURCE_DIR>' && make -j4")
7070
else()
7171
# Unix/macOS: Use native tools
7272
set(ATARI800_CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/scripts/configure-atari800.sh <SOURCE_DIR>)
@@ -116,8 +116,7 @@ if(WIN32)
116116
COMMAND ${CMAKE_COMMAND} -E echo "=== Verifying libatari800 build on Windows ==="
117117
COMMAND ${CMAKE_COMMAND} -E echo "Expected library: ${ATARI800_LIBRARY}"
118118
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"
119+
COMMAND ${MSYS2_BASH} -l -c "export PATH='/mingw64/bin:$PATH' && 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"
121120
COMMENT "Verifying libatari800 library creation"
122121
)
123122
endif()

0 commit comments

Comments
 (0)