Add support for MorphOS

This commit is contained in:
Cameron Armstrong (Nightfox)
2024-08-31 03:57:46 +08:00
parent daff6eb746
commit ca1a6b0cc9
2 changed files with 31 additions and 6 deletions

View File

@@ -69,8 +69,7 @@ option(DISABLE_JSON_PATCH "Disable JSON patch (RFC6902) support."
option(NEWLOCALE_NEEDS_FREELOCALE "Work around newlocale bugs in old FreeBSD by calling freelocale" OFF)
option(BUILD_APPS "Default to building apps" ON)
if (${CMAKE_SYSTEM_NAME} STREQUAL "AmigaOS")
set(AMIGA ON)
if (AMIGA)
set(DISABLE_THREAD_LOCAL_STORAGE ON)
set(ENABLE_THREADING OFF)
set(BUILD_SHARED_LIBS OFF)
@@ -79,7 +78,6 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "AmigaOS")
if ($ENV{CROSS_PFX} STREQUAL "m68k-amigaos")
set(AMIGA_M68K ON)
set(BUILD_TESTING OFF)
message(STATUS "Building for Motorola 68k AmigaOS")
if (${M68K_CRT} STREQUAL "newlib")
set(NEWLIB ON)
elseif(${M68K_CRT} STREQUAL "clib2")
@@ -93,9 +91,19 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "AmigaOS")
else()
set(NEWLIB ON)
endif()
message(STATUS "Building for Motorola 68k AmigaOS using CRT: ${M68K_CRT}")
elseif ($ENV{CROSS_PFX} STREQUAL "ppc-amigaos")
set(AMIGA_PPC ON)
message(STATUS "Building for PowerPC AmigaOS")
elseif($ENV{CROSS_PFX} STREQUAL "ppc-morphos")
set(MORPHOS ON)
if (NOIXEMUL)
message(STATUS "Building for PowerPC MorphOS without ixemul")
set(DISABLE_WERROR ON)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -noixemul")
else()
message(STATUS "Building for PowerPC MorphOS with ixemul")
endif()
else()
message(FATAL_ERROR "Unsupported AmigaOS target")
endif()