2021-04-09 15:24:47 +00:00
|
|
|
SET(CMAKE_SYSTEM_NAME Generic)
|
|
|
|
|
|
|
|
SET(PLATFORM_DREAMCAST TRUE)
|
|
|
|
|
|
|
|
SET(CMAKE_SYSTEM_VERSION 1)
|
|
|
|
|
|
|
|
set(CMAKE_CROSSCOMPILING TRUE)
|
|
|
|
|
2021-05-23 12:24:29 +00:00
|
|
|
IF(WIN32)
|
2021-05-23 12:25:52 +00:00
|
|
|
set(CMAKE_C_COMPILER $ENV{KOS_CC_BASE}/bin/sh-elf-gcc.exe)
|
|
|
|
set(CMAKE_CXX_COMPILER $ENV{KOS_CC_BASE}/bin/sh-elf-g++.exe)
|
2021-05-23 12:24:29 +00:00
|
|
|
ELSE()
|
|
|
|
set(CMAKE_C_COMPILER $ENV{KOS_CC_BASE}/bin/sh-elf-gcc)
|
|
|
|
set(CMAKE_CXX_COMPILER $ENV{KOS_CC_BASE}/bin/sh-elf-g++)
|
|
|
|
ENDIF()
|
2021-04-09 15:24:47 +00:00
|
|
|
|
|
|
|
add_compile_options(-ml -m4-single-only -ffunction-sections -fdata-sections)
|
|
|
|
|
2021-07-05 19:12:10 +00:00
|
|
|
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()
|
2021-04-09 15:24:47 +00:00
|
|
|
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)
|
2021-07-05 19:12:10 +00:00
|
|
|
ENDIF()
|
2021-04-09 15:24:47 +00:00
|
|
|
|
|
|
|
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
|
|
|
|
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
|
|
|
|
|
|
|
set(CMAKE_SYSTEM_INCLUDE_PATH "${CMAKE_SYSTEM_INCLUDE_PATH} $ENV{KOS_BASE}/include $ENV{KOS_BASE}/kernel/arch/dreamcast/include $ENV{KOS_BASE}/addons/include $ENV{KOS_BASE}/../kos-ports/include")
|
|
|
|
|
|
|
|
INCLUDE_DIRECTORIES(
|
|
|
|
$ENV{KOS_BASE}/include
|
|
|
|
$ENV{KOS_BASE}/kernel/arch/dreamcast/include
|
|
|
|
$ENV{KOS_BASE}/addons/include
|
|
|
|
$ENV{KOS_BASE}/../kos-ports/include
|
|
|
|
)
|
|
|
|
|
|
|
|
LINK_DIRECTORIES(
|
|
|
|
$ENV{KOS_BASE}/addons/lib/dreamcast
|
|
|
|
$ENV{KOS_PORTS}/lib
|
|
|
|
)
|
|
|
|
|
|
|
|
IF(${CMAKE_BUILD_TYPE} MATCHES Debug)
|
|
|
|
LINK_DIRECTORIES($ENV{KOS_BASE}/lib/dreamcast/debug)
|
|
|
|
ELSE()
|
|
|
|
LINK_DIRECTORIES($ENV{KOS_BASE}/lib/dreamcast)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
add_link_options(-L$ENV{KOS_BASE}/lib/dreamcast)
|
|
|
|
link_libraries(-Wl,--start-group -lstdc++ -lkallisti -lc -lgcc -Wl,--end-group m)
|
|
|
|
|
2023-03-04 22:11:11 +00:00
|
|
|
SET(CMAKE_EXECUTABLE_SUFFIX_C ".elf")
|
2021-04-09 15:24:47 +00:00
|
|
|
SET(CMAKE_EXECUTABLE_SUFFIX_CXX ".elf")
|
|
|
|
|
|
|
|
ADD_DEFINITIONS(
|
|
|
|
-D__DREAMCAST__
|
|
|
|
-DDREAMCAST
|
|
|
|
-D_arch_dreamcast
|
|
|
|
-D__arch_dreamcast
|
2021-07-05 19:12:10 +00:00
|
|
|
-D_arch_sub_$ENV{KOS_SUBARCH}
|
2021-04-09 15:24:47 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
if (NOT CMAKE_BUILD_TYPE MATCHES Debug)
|
|
|
|
ADD_DEFINITIONS(-DNDEBUG)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
SET(CMAKE_ASM_FLAGS "")
|
|
|
|
SET(CMAKE_ASM_FLAGS_RELEASE "")
|