Skip to content

Commit 606da1e

Browse files
committed
Update files to support Win on ARM32
1 parent 514e3a5 commit 606da1e

File tree

4 files changed

+26
-40
lines changed

4 files changed

+26
-40
lines changed

CMakeLists.txt

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -147,20 +147,10 @@ set(BUILD_ARCH "unknown")
147147
if (CMAKE_GENERATOR_PLATFORM)
148148
set(BUILD_ARCH "${CMAKE_GENERATOR_PLATFORM}")
149149
endif()
150-
if(arch_lower MATCHES "arm64" OR arch_lower MATCHES "aarch64" OR ${CMAKE_GENERATOR} MATCHES "(ARM64)" OR ${BUILD_ARCH} MATCHES "(ARM64)")
151-
set(DEPENDENCIES "dependencies-win-aarch64")
152-
elseif(CMAKE_SIZEOF_VOID_P EQUAL 8)
153-
set(DEPENDENCIES "dependencies-win-x86_64")
154-
else()
155-
set(DEPENDENCIES "dependencies-win-i686")
156-
endif()
157150

158151
if(WIN32)
159152
ADD_DEFINITIONS(-DUNICODE)
160153
ADD_DEFINITIONS(-D_UNICODE)
161-
if(NOT IS_DIRECTORY "${PROJECT_SOURCE_DIR}/${DEPENDENCIES}")
162-
message(FATAL_ERROR "Dependencies directory not found, make sure dependencies-win-(arch) exists inside stk-code directory.")
163-
endif()
164154
endif()
165155

166156
# These variables enable MSVC to find libraries located in "dependencies"
@@ -822,10 +812,6 @@ endif()
822812

823813
if(MSVC OR MINGW)
824814
target_link_libraries(supertuxkart iphlpapi.lib)
825-
add_custom_command(TARGET supertuxkart POST_BUILD
826-
COMMAND ${CMAKE_COMMAND} -E copy_directory
827-
"${PROJECT_SOURCE_DIR}/${DEPENDENCIES}/bin"
828-
$<TARGET_FILE_DIR:supertuxkart>)
829815
add_custom_target(stkshaders SOURCES ${STK_SHADERS})
830816
endif()
831817

@@ -893,9 +879,9 @@ endif()
893879

894880
# ==== Install target ====
895881
install(TARGETS supertuxkart RUNTIME DESTINATION ${STK_INSTALL_BINARY_DIR} BUNDLE DESTINATION .)
896-
install(DIRECTORY ${STK_DATA_DIR} DESTINATION ${STK_INSTALL_DATA_DIR} PATTERN ".svn" EXCLUDE PATTERN ".git" EXCLUDE)
882+
install(DIRECTORY ${STK_DATA_DIR} DESTINATION ${CMAKE_INSTALL_PREFIX} PATTERN ".svn" EXCLUDE PATTERN ".git" EXCLUDE)
897883
if(STK_ASSETS_DIR AND CHECK_ASSETS)
898-
install(DIRECTORY ${STK_ASSETS_DIR} DESTINATION ${STK_INSTALL_DATA_DIR}/data PATTERN ".svn" EXCLUDE PATTERN ".git" EXCLUDE)
884+
install(DIRECTORY ${STK_ASSETS_DIR} DESTINATION ${CMAKE_INSTALL_PREFIX}/data PATTERN ".svn" EXCLUDE PATTERN ".git" EXCLUDE)
899885
endif()
900886
install(FILES ${STK_DATA_DIR}/supertuxkart.desktop DESTINATION share/applications)
901887
install(FILES data/supertuxkart_16.png DESTINATION share/icons/hicolor/16x16/apps RENAME supertuxkart.png)

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,25 @@
1-
# SuperTuxKart
1+
# SuperTuxKart - for Windows on ARM32
2+
3+
SuperTuxKart is a free kart racing game. It focuses on fun and not on realistic kart physics. Instructions can be found on the in-game help page.
4+
5+
The SuperTuxKart homepage can be found at <https://supertuxkart.net/>. There is also our [FAQ](https://supertuxkart.net/FAQ) and information on how get in touch with the [community](https://supertuxkart.net/Community).
6+
7+
Latest release binaries can be found [here](https://download.pahaze.net/ARM/).
8+
9+
## Building
10+
Building for Windows on ARM32 is very straightforward. Build all needed dependencies with MXE, then clone the 2 projects (stk-assets, stk-code) as normal. In stk-code, run a general CMake setup:
11+
12+
```sh
13+
mkdir build
14+
cd build
15+
armv7-w64-mingw32-cmake -DUSE_DIRECTX=ON -DSPIRV_TOOLS_BUILD_STATIC=OFF ..
16+
```
17+
18+
Then from there, build as normal and install! The data dir was set to move to where it should be by default for Windows.
19+
20+
# Original README
21+
22+
## SuperTuxKart
223
[![Linux build status](https://github.com/supertuxkart/stk-code/actions/workflows/linux.yml/badge.svg)](https://github.com/supertuxkart/stk-code/actions/workflows/linux.yml)
324
[![Apple build status](https://github.com/supertuxkart/stk-code/actions/workflows/apple.yml/badge.svg)](https://github.com/supertuxkart/stk-code/actions/workflows/apple.yml)
425
[![Windows build status](https://github.com/supertuxkart/stk-code/actions/workflows/windows.yml/badge.svg)](https://github.com/supertuxkart/stk-code/actions/workflows/windows.yml)

src/config/user_config.hpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -712,15 +712,9 @@ namespace UserConfigParams
712712
PARAM_DEFAULT( FloatUserConfigParam(3, "font_size",
713713
&m_video_group, "The size of fonts. 0 is the smallest and 6 is the biggest") );
714714

715-
#if defined(_IRR_COMPILE_WITH_DIRECT3D_9_) && defined(_M_ARM64)
716715
PARAM_PREFIX StringUserConfigParam m_render_driver
717716
PARAM_DEFAULT( StringUserConfigParam("directx9", "render_driver",
718-
&m_video_group, "Render video driver to use, at the moment gl or directx9 is supported.") );
719-
#else
720-
PARAM_PREFIX StringUserConfigParam m_render_driver
721-
PARAM_DEFAULT( StringUserConfigParam("gl", "render_driver",
722-
&m_video_group, "Render video driver to use, at the moment gl or directx9 is supported.") );
723-
#endif
717+
&m_video_group, "Render video driver to use, only use directx9, gl doesn't work.") );
724718

725719
// ---- Recording
726720
PARAM_PREFIX GroupUserConfigParam m_recording_group

src/utils/crash_reporting.cpp

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -240,22 +240,7 @@
240240
stackframe.AddrPC.Mode = AddrModeFlat;
241241
stackframe.AddrStack.Mode = AddrModeFlat;
242242
stackframe.AddrFrame.Mode = AddrModeFlat;
243-
#if defined(_M_ARM64)
244-
stackframe.AddrPC.Offset = pContext->Pc;
245-
stackframe.AddrStack.Offset = pContext->Sp;
246-
stackframe.AddrFrame.Offset = pContext->Fp;
247-
const DWORD machine_type = IMAGE_FILE_MACHINE_ARM64;
248-
#elif defined(_WIN64)
249-
stackframe.AddrPC.Offset = pContext->Rip;
250-
stackframe.AddrStack.Offset = pContext->Rsp;
251-
stackframe.AddrFrame.Offset = pContext->Rbp;
252-
const DWORD machine_type = IMAGE_FILE_MACHINE_AMD64;
253-
#else
254-
stackframe.AddrPC.Offset = pContext->Eip;
255-
stackframe.AddrStack.Offset = pContext->Esp;
256-
stackframe.AddrFrame.Offset = pContext->Ebp;
257-
const DWORD machine_type = IMAGE_FILE_MACHINE_I386;
258-
#endif
243+
const DWORD machine_type = IMAGE_FILE_MACHINE_ARM;
259244

260245

261246
// Walk the stack

0 commit comments

Comments
 (0)