From d30725277264d419f5e04baab4269d4e49850148 Mon Sep 17 00:00:00 2001 From: James Benton Date: Wed, 10 May 2017 17:47:11 +0100 Subject: [PATCH] cmake: Fix wut-toolchain.cmake with empty CMAKE_{INCLUDE,LIBRARY}_PATH. --- cmake/wut-toolchain.cmake | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/cmake/wut-toolchain.cmake b/cmake/wut-toolchain.cmake index 8c5153e..5ef2410 100644 --- a/cmake/wut-toolchain.cmake +++ b/cmake/wut-toolchain.cmake @@ -47,17 +47,27 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) set(DEVKIT_COMPILE_FLAGS "-mcpu=750 -meabi -mhard-float -mno-sdata") set(DEVKIT_LINKER_FLAGS "-nostartfiles -L${DEVKITPPC}/lib") -set(RPX_COMPILE_FLAGS "\ - ${DEVKIT_COMPILE_FLAGS} \ - -I${CMAKE_INCLUDE_PATH}") +set(RPX_COMPILE_FLAGS "${DEVKIT_COMPILE_FLAGS}") set(RPX_LINKER_FLAGS "\ ${DEVKIT_LINKER_FLAGS} \ -pie -fPIE -z common-page-size=64 -z max-page-size=64 -T ${WUT_ROOT}/rules/rpl.ld\ - -L${WUT_ROOT}/lib -L${CMAKE_LIBRARY_PATH} -Wl,-wrap,__eabi") + -L${WUT_ROOT}/lib -Wl,-wrap,__eabi") set(ELF_TO_RPL ${WUT_ROOT}/bin/elf2rpl${CMAKE_EXECUTABLE_SUFFIX}) +if(CMAKE_INCLUDE_PATH) +set(RPX_COMPILE_FLAGS "\ + ${RPX_COMPILE_FLAGS} \ + -I${CMAKE_INCLUDE_PATH}") +endif() + +if(CMAKE_LIBRARY_PATH) +set(RPX_LINKER_FLAGS "\ + ${RPX_LINKER_FLAGS} \ + -L${CMAKE_LIBRARY_PATH}") +endif() + macro(add_rpx target) add_executable(${ARGV}) set_target_properties(${target} PROPERTIES