Cleanup some CMake stuff

This commit is contained in:
James Benton 2018-06-14 11:44:23 +01:00
parent 546a356697
commit e89b248a15
2 changed files with 14 additions and 15 deletions

View File

@ -30,10 +30,12 @@ if(WUT_BUILD_TOOLS)
endif()
if(WUT_BUILD_PPC)
set(DEVKITPPC $ENV{DEVKITPPC} CACHE STRING "Path to devkitPPC install")
if(NOT WUT_BUILD_TOOLS)
message(FATAL_ERROR "WUT_BUILD_PPC requires WUT_BUILD_TOOLS.")
endif()
if(NOT DEVKITPPC)
message(FATAL_ERROR "You must have defined DEVKITPPC to build PPC libraries.")
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")
@ -43,7 +45,6 @@ if(WUT_BUILD_PPC)
CMAKE_GENERATOR "Unix Makefiles"
INSTALL_DIR "${WUT_STAGING}"
CMAKE_CACHE_ARGS
-DDEVKITPPC:string=${DEVKITPPC}
-DWUT_ROOT:filepath=${WUT_ROOT}
-DWUT_RPLIMPORTGEN:filepath=$<TARGET_FILE:rplimportgen>
-DCMAKE_TOOLCHAIN_FILE:filepath=${WUT_TOOLCHAIN}
@ -56,7 +57,6 @@ if(WUT_BUILD_PPC)
CMAKE_GENERATOR "Unix Makefiles"
INSTALL_DIR "${WUT_STAGING}"
CMAKE_CACHE_ARGS
-DDEVKITPPC:string=${DEVKITPPC}
-DWUT_ROOT:filepath=${WUT_ROOT}
-DCMAKE_TOOLCHAIN_FILE:filepath=${WUT_TOOLCHAIN}
-DCMAKE_INSTALL_PREFIX:string=<INSTALL_DIR>

View File

@ -5,21 +5,20 @@ set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSTEM_PROCESSOR "ppc")
set(CMAKE_CROSSCOMPILING 1)
set(DEVKITPPC $ENV{DEVKITPPC} CACHE STRING "Path to devkitPPC install")
set(WUT_ROOT $ENV{WUT_ROOT} CACHE STRING "Path to wut install")
if(NOT DEVKITPPC)
if(NOT DEFINED ENV{DEVKITPPC})
message(FATAL_ERROR "You must have defined DEVKITPPC before calling cmake.")
endif()
if(NOT WUT_ROOT)
get_filename_component(WUT_ROOT ${CMAKE_CURRENT_LIST_DIR} DIRECTORY)
if(NOT DEFINED ENV{WUT_ROOT})
if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/../share/wut.cmake)
get_filename_component(ENV{WUT_ROOT} ${CMAKE_CURRENT_LIST_DIR} DIRECTORY)
else()
message(FATAL_ERROR "You must have defined WUT_ROOT before calling cmake.")
endif()
endif()
if(WIN32)
# Because "Unix Makefiles" generator does not set this, even if on Windows
set(CMAKE_EXECUTABLE_SUFFIX ".exe")
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 "")