From c273481547a2c5e3b88551800ce1d7e6ed78a557 Mon Sep 17 00:00:00 2001 From: Yvan Janssens Date: Mon, 28 Oct 2019 18:40:28 +0000 Subject: [PATCH] Added support for 32b ARM Windows. This would allow the build of WoA binaries, as well as SurfaceRT versions. --- CMakeLists.txt | 26 ++++++++++++++++++++------ cmake/toolchain_arm-mingw.txt | 14 ++++++++++++++ 2 files changed, 34 insertions(+), 6 deletions(-) create mode 100644 cmake/toolchain_arm-mingw.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 4d1c4ad..04b0f8f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,10 @@ project (MinivMac) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -DMACII") +if (WIN32) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DGUI_WINDOWS") +endif() + set ( BASE_SOURCES src/M68KCpuEmulator.c src/M68KInstructionTable.c @@ -29,17 +33,27 @@ set ( SDL_SOURCES src/platforms/SDL_WithRom.c ) +set ( WIN_SOURCES + src/platforms/Windows_WithRom.c +) + set ( MAIN_SOURCES src/ProgramMain.c ) -add_subdirectory(SDL2) - add_library (minivmac_base ${BASE_SOURCES}) -add_library (minivmac_uisdl ${SDL_SOURCES}) -target_link_libraries(minivmac_uisdl SDL2-static ) - add_executable(minivmac ${MAIN_SOURCES}) target_link_libraries(minivmac minivmac_base) -target_link_libraries(minivmac minivmac_uisdl) + +if (WIN32) + set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -mwindows") + add_library (minivmac_uiwin ${WIN_SOURCES}) + target_link_libraries(minivmac minivmac_uiwin) + target_link_libraries(minivmac winmm) +else() + add_subdirectory(SDL2) + add_library (minivmac_uisdl ${SDL_SOURCES}) + target_link_libraries(minivmac_uisdl SDL2-static) + target_link_libraries(minivmac minivmac_uisdl) +endif() diff --git a/cmake/toolchain_arm-mingw.txt b/cmake/toolchain_arm-mingw.txt new file mode 100644 index 0000000..45667f5 --- /dev/null +++ b/cmake/toolchain_arm-mingw.txt @@ -0,0 +1,14 @@ +# +# CMAKE_TOOLCHAIN_FILE +# +# the name of the target operating system +set(CMAKE_SYSTEM_NAME Windows) + +# for 32 or 64 bits mingw-w64 +# see http://mingw-w64.sourceforge.net/ +set(COMPILER_PREFIX "armv7-w64-mingw32") + +set(CMAKE_C_COMPILER ${COMPILER_PREFIX}-gcc) +set(CMAKE_CXX_COMPILER ${COMPILER_PREFIX}-g++) + +set(CMAKE_RC_COMPILER ${COMPILER_PREFIX}-windres)