From 08eebfccc05bf7b4811c85b853770335e495d047 Mon Sep 17 00:00:00 2001 From: T_chan Date: Mon, 5 Jul 2021 19:12:10 +0000 Subject: [PATCH] Enable building for sub-architecture naomi. Tested with examples nehe02, nehe06, nehe08 - displays the same as on Dreamcast. --- toolchains/Dreamcast.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/toolchains/Dreamcast.cmake b/toolchains/Dreamcast.cmake index b264a31..fa5110c 100644 --- a/toolchains/Dreamcast.cmake +++ b/toolchains/Dreamcast.cmake @@ -16,7 +16,11 @@ ENDIF() add_compile_options(-ml -m4-single-only -ffunction-sections -fdata-sections) +IF($ENV{KOS_SUBARCH} MATCHES naomi) +set(CMAKE_EXE_LINKER_FLAGS " -ml -m4-single-only -Wl,-Ttext=0x8c020000 -Wl,--gc-sections -T$ENV{KOS_BASE}/utils/ldscripts/shlelf-naomi.xc -nodefaultlibs" CACHE INTERNAL "" FORCE) +ELSE() set(CMAKE_EXE_LINKER_FLAGS " -ml -m4-single-only -Wl,-Ttext=0x8c010000 -Wl,--gc-sections -T$ENV{KOS_BASE}/utils/ldscripts/shlelf.xc -nodefaultlibs" CACHE INTERNAL "" FORCE) +ENDIF() set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) @@ -53,7 +57,7 @@ ADD_DEFINITIONS( -DDREAMCAST -D_arch_dreamcast -D__arch_dreamcast - -D_arch_sub_pristine + -D_arch_sub_$ENV{KOS_SUBARCH} ) if (NOT CMAKE_BUILD_TYPE MATCHES Debug)