mirror of
https://git.yoctoproject.org/poky
synced 2026-04-27 21:32:13 +02:00
As discussion in [YOCTO #14717] cmake contains a OEToolchainConfig.cmake file to configure the toolchain correctly in cross-compile build for recipes using cmake. The variable CMAKE_LDFLAGS_FLAGS is spelled incorrectly, cmake expects CMAKE_SHARED_LINKER_FLAGS, CMAKE_STATIC_LINKER_FLAGS, CMAKE_EXE_LINKER_FLAGS and CMAKE_MODULE_LINKER_FLAGS to be set instead. As cmake already correctly initializes these from environment there is no need to specify the linker flags in the toolchain file at all. So this just removes the variable, as its value was also set wrong. (From OE-Core rev: 52e59a5b37f55905ee693a99f9ffc34ed41b4283) Signed-off-by: Martin Beeger <martin.beeger@online.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
25 lines
1005 B
CMake
25 lines
1005 B
CMake
set( CMAKE_SYSTEM_NAME Linux )
|
|
set( CMAKE_C_FLAGS $ENV{CFLAGS} CACHE STRING "" FORCE )
|
|
set( CMAKE_CXX_FLAGS $ENV{CXXFLAGS} CACHE STRING "" FORCE )
|
|
set( CMAKE_ASM_FLAGS ${CMAKE_C_FLAGS} CACHE STRING "" FORCE )
|
|
set( CMAKE_SYSROOT $ENV{OECORE_TARGET_SYSROOT} )
|
|
|
|
set( CMAKE_FIND_ROOT_PATH $ENV{OECORE_TARGET_SYSROOT} )
|
|
set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER )
|
|
set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
|
|
set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )
|
|
set( CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY )
|
|
|
|
set(CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX "$ENV{OE_CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX}")
|
|
|
|
# Set CMAKE_SYSTEM_PROCESSOR from the sysroot name (assuming processor-distro-os).
|
|
if ($ENV{SDKTARGETSYSROOT} MATCHES "/sysroots/([a-zA-Z0-9_-]+)-.+-.+")
|
|
set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_MATCH_1})
|
|
endif()
|
|
|
|
# Include the toolchain configuration subscripts
|
|
file( GLOB toolchain_config_files "${CMAKE_CURRENT_LIST_FILE}.d/*.cmake" )
|
|
foreach(config ${toolchain_config_files})
|
|
include(${config})
|
|
endforeach()
|