mirror of
https://github.com/mwpenny/portal64-still-alive.git
synced 2024-10-19 22:27:36 -04:00
Add barebones N64 CMake toolchain files
Just focus on compilation for now
This commit is contained in:
parent
fa0940fe90
commit
a67288f62e
9
cmake/toolchain_libultra.cmake
Normal file
9
cmake/toolchain_libultra.cmake
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
include("${CMAKE_CURRENT_LIST_DIR}/toolchain_n64.cmake")
|
||||||
|
set(LIBULTRA TRUE)
|
||||||
|
|
||||||
|
set(LIBULTRA_INCLUDE_DIRS
|
||||||
|
"${N64_TOOLCHAIN_PREFIX}/usr/include/n64"
|
||||||
|
"${N64_TOOLCHAIN_PREFIX}/usr/include/n64/PR"
|
||||||
|
)
|
||||||
|
|
||||||
|
# TODO: libs
|
21
cmake/toolchain_n64.cmake
Normal file
21
cmake/toolchain_n64.cmake
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
set(CMAKE_SYSTEM_NAME Generic)
|
||||||
|
|
||||||
|
set(N64_TOOLCHAIN_PREFIX "" CACHE PATH "Root directory of N64 toolchain")
|
||||||
|
set(N64_BIN_DIR "${N64_TOOLCHAIN_PREFIX}/bin")
|
||||||
|
|
||||||
|
# Search for programs in the host environment
|
||||||
|
# Search for headers and libraries in the target environment
|
||||||
|
set(CMAKE_FIND_ROOT_PATH "${N64_TOOLCHAIN_PREFIX}")
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||||
|
|
||||||
|
# Ensure CMake can find toolchain during compiler tests
|
||||||
|
list(APPEND CMAKE_TRY_COMPILE_PLATFORM_VARIABLES N64_TOOLCHAIN_PREFIX)
|
||||||
|
|
||||||
|
# Don't try to dynamically link during compiler tests
|
||||||
|
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
|
||||||
|
|
||||||
|
# TODO: find assembler, linker, etc.
|
||||||
|
# TODO: set flags
|
||||||
|
find_program(CMAKE_C_COMPILER mips64-elf-gcc PATHS ${N64_BIN_DIR} REQUIRED)
|
Loading…
Reference in a new issue