cmake: Easier setting of ARM cross compiler
Allows for an ARM cross compiler to be specified with just -DARM=TRUE when initializing cmake, instead of having to specify a full cross compilation prefix. This provides no additional functionality, but provides a nicer interface for users
This commit is contained in:
parent
c04d9ce8ce
commit
5e273cc7bd
1 changed files with 6 additions and 0 deletions
|
|
@ -20,6 +20,12 @@ set(CMAKE_SYSTEM_PROCESSOR seL4CPU)
|
|||
set(CMAKE_SYSROOT "${CMAKE_BINARY_DIR}")
|
||||
set(CMAKE_STAGING_PREFIX "${CMAKE_BINARY_DIR}/staging")
|
||||
|
||||
if("${CROSS_COMPILER_PREFIX}" STREQUAL "")
|
||||
if(ARM)
|
||||
set(CROSS_COMPILER_PREFIX "arm-linux-gnueabi-" CACHE INTERNAL "")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(CMAKE_C_COMPILER ${CROSS_COMPILER_PREFIX}gcc)
|
||||
set(CMAKE_ASM_COMPILER ${CROSS_COMPILER_PREFIX}gcc)
|
||||
set(CMAKE_CXX_COMPILER ${CROSS_COMPILER_PREFIX}g++)
|
||||
|
|
|
|||
Loading…
Reference in a new issue