Windows on ARM support + icon fixes (#129)
* Support for Windows on ARM (uses MSVC, but it's Windows 11 exclusive anyway so `¯\_(ツ)_/¯`) * Adds the icon back for x86/x64 TDM-GCC builds * Makes Linux compilation on ARM much faster * added tests to every workflow
This commit is contained in:
@@ -26,6 +26,24 @@ if (WIN32 AND NOT MSVC)
|
||||
set(CMAKE_C_COMPILER "C:/TDM-GCC-64/bin/gcc.exe" CACHE FILEPATH "C Compiler" FORCE)
|
||||
set(CMAKE_CXX_COMPILER "C:/TDM-GCC-64/bin/g++.exe" CACHE FILEPATH "C++ Compiler" FORCE)
|
||||
message(STATUS "[UMSKT] Forcing use of TDM-GCC in C:/TDM-GCC-64")
|
||||
|
||||
# Configure windres for resource compilation
|
||||
set(CMAKE_RC_COMPILER "C:/TDM-GCC-64/bin/windres.exe")
|
||||
set(CMAKE_RC_COMPILER_INIT windres)
|
||||
enable_language(RC)
|
||||
set(CMAKE_RC_FLAGS "--use-temp-file -c65001")
|
||||
|
||||
# Match resource architecture with target architecture
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
|
||||
set(CMAKE_RC_FLAGS "${CMAKE_RC_FLAGS} -F pe-i386")
|
||||
else()
|
||||
set(CMAKE_RC_FLAGS "${CMAKE_RC_FLAGS} -F pe-x86-64")
|
||||
endif()
|
||||
|
||||
set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> <FLAGS> -O coff -I${CMAKE_CURRENT_SOURCE_DIR}/src/windows <DEFINES> -i <SOURCE> -o <OBJECT>")
|
||||
|
||||
# Set the Windows resource file for GCC builds
|
||||
set(UMSKT_EXE_WINDOWS_EXTRA src/windows/umskt.rc)
|
||||
endif()
|
||||
|
||||
SET(CMAKE_CXX_STANDARD 17)
|
||||
@@ -36,6 +54,7 @@ OPTION(UMSKT_USE_SHARED_OPENSSL "Force linking against the system-wide OpenSSL l
|
||||
OPTION(MUSL_STATIC "Enable fully static builds in a muslc environment (i.e. Alpine Linux)" OFF)
|
||||
OPTION(DJGPP_WATT32 "Enable compilation and linking with DJGPP/WATT32/OpenSSL" OFF)
|
||||
OPTION(MSVC_MSDOS_STUB "Specify a custom MS-DOS stub for a 32-bit MSVC compilation" OFF)
|
||||
OPTION(WINDOWS_ARM "Enable compilation for Windows on ARM (requires appropriate toolchain)" OFF)
|
||||
|
||||
SET(UMSKT_LINK_LIBS ${UMSKT_LINK_LIBS})
|
||||
SET(UMSKT_LINK_DIRS ${UMSKT_LINK_DIRS})
|
||||
@@ -60,7 +79,22 @@ ELSE()
|
||||
MESSAGE(STATUS "[UMSKT] Requesting static version of OpenSSL")
|
||||
ENDIF()
|
||||
|
||||
|
||||
# Configure ARM-specific settings if enabled
|
||||
if (WINDOWS_ARM)
|
||||
if (MSVC)
|
||||
# MSVC ARM64 settings
|
||||
set(CMAKE_SYSTEM_PROCESSOR ARM64)
|
||||
set(CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE ARM64)
|
||||
else()
|
||||
# MinGW/GCC ARM settings
|
||||
set(CMAKE_SYSTEM_PROCESSOR arm)
|
||||
if (CMAKE_CROSSCOMPILING)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=armv8-a")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=armv8-a")
|
||||
endif()
|
||||
endif()
|
||||
message(STATUS "[UMSKT] Configuring for Windows on ARM")
|
||||
endif()
|
||||
|
||||
IF(DJGPP_WATT32)
|
||||
SET(CMAKE_SYSTEM_NAME MSDOS)
|
||||
|
||||
Reference in New Issue
Block a user