cmake: ARCH_ID fixes for cross compilation
This commit is contained in:
parent
f96e431a15
commit
0cb6a763c1
|
@ -115,6 +115,9 @@ string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_LOWER)
|
||||||
# to identify the target architecture, to direct logic in this cmake script.
|
# to identify the target architecture, to direct logic in this cmake script.
|
||||||
# Since ARCH is a cached variable, it will not be set on first cmake invocation.
|
# Since ARCH is a cached variable, it will not be set on first cmake invocation.
|
||||||
if (NOT ARCH OR ARCH STREQUAL "" OR ARCH STREQUAL "native" OR ARCH STREQUAL "default")
|
if (NOT ARCH OR ARCH STREQUAL "" OR ARCH STREQUAL "native" OR ARCH STREQUAL "default")
|
||||||
|
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "")
|
||||||
|
set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_HOST_SYSTEM_PROCESSOR})
|
||||||
|
endif()
|
||||||
set(ARCH_ID "${CMAKE_SYSTEM_PROCESSOR}")
|
set(ARCH_ID "${CMAKE_SYSTEM_PROCESSOR}")
|
||||||
else()
|
else()
|
||||||
set(ARCH_ID "${ARCH}")
|
set(ARCH_ID "${ARCH}")
|
||||||
|
|
|
@ -41,6 +41,8 @@ set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) # Find programs on host
|
||||||
set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) # Find libs in target
|
set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) # Find libs in target
|
||||||
set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) # Find includes in target
|
set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) # Find includes in target
|
||||||
|
|
||||||
|
set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_HOST_SYSTEM_PROCESSOR} CACHE STRING "" FORCE)
|
||||||
|
|
||||||
# specify the cross compiler to be used. Darwin uses clang provided by the SDK.
|
# specify the cross compiler to be used. Darwin uses clang provided by the SDK.
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||||
SET(CMAKE_C_COMPILER @prefix@/native/bin/clang)
|
SET(CMAKE_C_COMPILER @prefix@/native/bin/clang)
|
||||||
|
@ -85,6 +87,11 @@ endif()
|
||||||
|
|
||||||
if(ARCHITECTURE STREQUAL "i686" AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
if(ARCHITECTURE STREQUAL "i686" AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
SET(LINUX_32 ON)
|
SET(LINUX_32 ON)
|
||||||
|
SET(ARCH_ID "i386")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(ARCHITECTURE STREQUAL "x86_64" AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
|
SET(ARCH_ID "x86_64")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
#Create a new global cmake flag that indicates building with depends
|
#Create a new global cmake flag that indicates building with depends
|
||||||
|
|
Loading…
Reference in New Issue