Skip to content

Commit

Permalink
Added support for 32b ARM Windows.
Browse files Browse the repository at this point in the history
This would allow the build of WoA binaries, as well as SurfaceRT versions.
  • Loading branch information
Yvan Janssens committed Oct 28, 2019
1 parent c9f924f commit c273481
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 6 deletions.
26 changes: 20 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
14 changes: 14 additions & 0 deletions cmake/toolchain_arm-mingw.txt
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit c273481

Please sign in to comment.