ssxog/cmake/Toolchain/ps2.cmake

40 lines
1.5 KiB
CMake
Raw Permalink Normal View History

2022-06-18 02:54:01 -04:00
# Based off the shipped ps2dev.cmake toolchain file
# in the ps2sdk source tree, modified for more idiomatic CMake
set(CMAKE_SYSTEM_NAME Playstation2)
set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSTEM_PROCESSOR "ee")
# Make it so cmake sees modules here, so it can import
# our PlayStation2 platform. Otherwise, CMake will yell
# and complain (rightfully.)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
# C/C++ compiler
set(CMAKE_C_COMPILER $ENV{SCE}/ee/gcc/bin/ee-gcc)
set(CMAKE_CXX_COMPILER $ENV{SCE}/ee/gcc/bin/ee-g++)
2022-06-18 02:54:01 -04:00
# We can't use the compiler generated dependency files,
# since it adds flags GCC 2.9 doesn't understand.
# While it understands -MD, it does not understand -MT or -MF,
# which causes the actual build to end up failing.
#
# This option is only obeyed with the Makefile generator,
# which is why Ninja cannot be used.
2022-06-18 02:54:01 -04:00
set(CMAKE_DEPENDS_USE_COMPILER OFF)
set(CMAKE_C_FLAGS_INIT "-I$ENV{SCE}/ee/include -I$ENV{SCE}/common/include -DBX_PLATFORM_PS2 -DBX_PS2_SONYSDK -fno-exceptions -fno-common")
2022-06-18 02:54:01 -04:00
set(CMAKE_C_FLAGS_RELEASE_INIT "${CMAKE_C_FLAGS_INIT}")
set(CMAKE_CXX_FLAGS_INIT "${CMAKE_C_FLAGS_INIT}")
set(CMAKE_CXX_FLAGS_RELEASE_INIT "${CMAKE_C_FLAGS_RELEASE_INIT} ${CMAKE_CXX_FLAGS_INIT}")
set(CMAKE_EXE_LINKER_FLAGS_INIT " -L$ENV{SCE}/ee/lib -mno-crt0 -T $ENV{SCE}/ee/lib/app.cmd")
2022-06-18 02:54:01 -04:00
set(CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT "")
set(CMAKE_FIND_ROOT_PATH $ENV{SCE} $ENV{SCE}/ee)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)