mirror of
https://github.com/wiiu-env/wut.git
synced 2025-01-08 14:30:41 +01:00
cmake: Try find DEVKITPPC from PATH.
This commit is contained in:
parent
9e0394aae3
commit
58d967ce0c
@ -34,10 +34,6 @@ if(WUT_BUILD_PPC)
|
||||
message(FATAL_ERROR "WUT_BUILD_PPC requires WUT_BUILD_TOOLS.")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED ENV{DEVKITPPC})
|
||||
message(FATAL_ERROR "You must have defined DEVKITPPC in your environment to build PPC libraries.")
|
||||
endif()
|
||||
|
||||
set(WUT_TOOLCHAIN "${CMAKE_CURRENT_SOURCE_DIR}/share/wut.toolchain.cmake")
|
||||
|
||||
externalproject_add(cafe
|
||||
|
@ -5,23 +5,30 @@ set(CMAKE_SYSTEM_VERSION 1)
|
||||
set(CMAKE_SYSTEM_PROCESSOR "ppc")
|
||||
set(CMAKE_CROSSCOMPILING 1)
|
||||
|
||||
if(NOT DEFINED ENV{DEVKITPPC})
|
||||
message(FATAL_ERROR "You must have defined DEVKITPPC before calling cmake.")
|
||||
find_program(DEVKITPPC_GCC NAMES powerpc-eabi-gcc)
|
||||
if(DEVKITPPC_GCC)
|
||||
get_filename_component(DEVKITPPC_BIN ${DEVKITPPC_GCC} DIRECTORY)
|
||||
get_filename_component(DEVKITPPC ${DEVKITPPC_BIN} DIRECTORY)
|
||||
else()
|
||||
if(NOT DEFINED ENV{DEVKITPPC})
|
||||
message(FATAL_ERROR "You must have added DEVKITPPC to PATH or defined DEVKITPPC before calling cmake.")
|
||||
endif()
|
||||
set(DEVKITPPC $ENV{DEVKITPPC})
|
||||
set(DEVKITPPC_BIN "${DEVKITPPC}/bin")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED ENV{WUT_ROOT})
|
||||
message(FATAL_ERROR "You must have defined WUT_ROOT before calling cmake.")
|
||||
endif()
|
||||
|
||||
set(DEVKITPPC $ENV{DEVKITPPC})
|
||||
set(WUT_ROOT $ENV{WUT_ROOT})
|
||||
|
||||
set(CMAKE_ASM_COMPILER "${DEVKITPPC}/bin/powerpc-eabi-gcc${CMAKE_EXECUTABLE_SUFFIX}" CACHE PATH "")
|
||||
set(CMAKE_C_COMPILER "${DEVKITPPC}/bin/powerpc-eabi-gcc${CMAKE_EXECUTABLE_SUFFIX}" CACHE PATH "")
|
||||
set(CMAKE_CXX_COMPILER "${DEVKITPPC}/bin/powerpc-eabi-g++${CMAKE_EXECUTABLE_SUFFIX}" CACHE PATH "")
|
||||
set(CMAKE_LINKER "${DEVKITPPC}/bin/powerpc-eabi-ld${CMAKE_EXECUTABLE_SUFFIX}" CACHE PATH "")
|
||||
set(CMAKE_AR "${DEVKITPPC}/bin/powerpc-eabi-ar${CMAKE_EXECUTABLE_SUFFIX}" CACHE PATH "")
|
||||
set(CMAKE_STRIP "${DEVKITPPC}/bin/powerpc-eabi-strip${CMAKE_EXECUTABLE_SUFFIX}" CACHE PATH "")
|
||||
set(CMAKE_ASM_COMPILER "${DEVKITPPC_BIN}/powerpc-eabi-gcc" CACHE PATH "")
|
||||
set(CMAKE_C_COMPILER "${DEVKITPPC_BIN}/powerpc-eabi-gcc" CACHE PATH "")
|
||||
set(CMAKE_CXX_COMPILER "${DEVKITPPC_BIN}/powerpc-eabi-g++" CACHE PATH "")
|
||||
set(CMAKE_LINKER "${DEVKITPPC_BIN}/powerpc-eabi-ld" CACHE PATH "")
|
||||
set(CMAKE_AR "${DEVKITPPC_BIN}/powerpc-eabi-ar" CACHE PATH "")
|
||||
set(CMAKE_STRIP "${DEVKITPPC_BIN}/powerpc-eabi-strip" CACHE PATH "")
|
||||
|
||||
set(WUT_C_FLAGS "-mcpu=750 -meabi -mhard-float -Wl,-q -D__WIIU__ -D__WUT__")
|
||||
set(CMAKE_C_FLAGS "${WUT_C_FLAGS}" CACHE STRING "")
|
||||
@ -40,8 +47,8 @@ set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|
||||
|
||||
# Tools
|
||||
set(WUT_ELF2RPL "${WUT_ROOT}/bin/elf2rpl${CMAKE_EXECUTABLE_SUFFIX}" CACHE PATH "")
|
||||
set(WUT_RPLEXPORTGEN "${WUT_ROOT}/bin/rplexportgen${CMAKE_EXECUTABLE_SUFFIX}" CACHE PATH "")
|
||||
set(WUT_ELF2RPL "${WUT_ROOT}/bin/elf2rpl" CACHE PATH "")
|
||||
set(WUT_RPLEXPORTGEN "${WUT_ROOT}/bin/rplexportgen" CACHE PATH "")
|
||||
|
||||
# Flags
|
||||
set(WUT TRUE)
|
||||
|
Loading…
Reference in New Issue
Block a user