1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-06-23 13:33:15 +00:00

Fix cross-compilation when usign the SDK

This commit is contained in:
Carles Fernandez 2021-06-21 11:08:15 +02:00
parent d00d0615e3
commit ecc339e68b
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D

View File

@ -23,6 +23,16 @@ if(NOT CMAKE_BUILD_TYPE)
FORCE)
endif()
# Workaround for cross-compilation with SDK
if(DEFINED ENV{OECORE_TARGET_SYSROOT})
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/Toolchains/oe-sdk_cross.cmake)
set(CMAKE_CROSSCOMPILING ON)
include(${CMAKE_TOOLCHAIN_FILE})
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^cortexa9hf")
set(CMAKE_SYSTEM_PROCESSOR arm-${CMAKE_SYSTEM_PROCESSOR})
endif()
endif()
# BUILD_TESTING is a standard CMake variable, but we declare it here to make it
# prominent in the GUI.
option(BUILD_TESTING "Enable test (depends on googletest)." OFF)