Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y ninja-build xvfb xorg-dev libgl1-mesa-dev libglu1-mesa-dev libgl1-mesa-dri
sudo apt-get install -y xorg-dev libgl1-mesa-dev libglu1-mesa-dev libgl1-mesa-dri
shell: bash

- name: Install GCC 16
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/ci-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ jobs:
with:
submodules: 'recursive'

- name: Install ninja-build
run: |
brew install ninja
shell: bash

- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/ci-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,6 @@ jobs:
working-directory: build/tests
run: |
set -o pipefail
if [ "${{ matrix.compiler }}" == "gcc" ]; then
# For MinGW - copy DLLs directly (no PATH manipulation)
GCC_DIR=$(dirname $(which gcc))
echo "GCC directory: $GCC_DIR"
echo "Copying DLLs from $GCC_DIR"
cp "$GCC_DIR"/libgcc*.dll . 2>/dev/null || echo "No libgcc DLLs found"
cp "$GCC_DIR"/libstdc*.dll . 2>/dev/null || echo "No libstdc DLLs found"
cp "$GCC_DIR"/libwinpthread*.dll . 2>/dev/null || echo "No libwinpthread DLLs found"
fi
echo "Running gamecoe tests"
./gamecoe_tests.exe | tee test_output.log
# testcoe currently reports a skipped test as failed. Narrow this back to skips only
Expand Down
42 changes: 42 additions & 0 deletions cmake/utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,46 @@ function(copy_gamecoe_assets_to_build_root exe)
COMMENT "[gamecoe] Copying gamecoe assets to build root"
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
endfunction()

# Automatically copies required MinGW DLLs to target directory on Windows

function(gamecoe_copy_mingw_dlls_to_target target_name)
if(WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
message(STATUS "[gamecoe] Setting up automatic MinGW DLL copying for ${target_name}")

# Get the compiler directory
get_filename_component(COMPILER_DIR ${CMAKE_CXX_COMPILER} DIRECTORY)

# List of DLLs that might be needed for MinGW
set(MINGW_DLLS
libgcc_s_seh-1.dll # 64-bit SEH exception handling
libgcc_s_dw2-1.dll # 32-bit Dwarf2 exception handling
libstdc++-6.dll # C++ standard library
libwinpthread-1.dll # Threading support
)

foreach(dll ${MINGW_DLLS})
set(dll_path "${COMPILER_DIR}/${dll}")
if(EXISTS "${dll_path}")
message(STATUS "[gamecoe] Found ${dll} at ${dll_path}")
add_custom_command(TARGET ${target_name} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${dll_path}"
"$<TARGET_FILE_DIR:${target_name}>/${dll}"
COMMENT "[gamecoe] Copying MinGW DLL: ${dll}"
VERBATIM
)
else()
message(STATUS "[gamecoe] ${dll} not found, skipping")
endif()
endforeach()
endif()
endfunction()

# Alternative function for multiple targets
function(gamecoe_copy_mingw_dlls_to_targets)
foreach(target_name ${ARGN})
gamecoe_copy_mingw_dlls_to_target(${target_name})
endforeach()
endfunction()
2 changes: 2 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ if(WIN32)
COMMAND_EXPAND_LISTS)
endif()

gamecoe_copy_mingw_dlls_to_target(gamecoe_tests)

# game::create() needs soundcoe's default audio root to exist next to the test binary
if(GAMECOE_USE_SOUNDCOE)
add_custom_command(TARGET gamecoe_tests POST_BUILD
Expand Down
Loading