1 From a42cfebcd6c684cccf8ad33e5bd5130f7cdba135 Mon Sep 17 00:00:00 2001
2 From: Cody P Schafer <dev@codyps.com>
3 Date: Thu, 27 Apr 2017 11:35:05 -0400
4 Subject: [PATCH] CMakeDetermineSystem: use oe environment vars to load default
7 Passing the toolchain by:
9 - shell aliases does not work if cmake is called by a script
10 - unconditionally by a wrapper script causes cmake to believe it is
11 configuring things when it is not (for example, `cmake --build` breaks).
13 The OE_CMAKE_TOOLCHAIN_FILE variable is only used as a default if no
14 toolchain is explicitly specified.
16 Setting the CMAKE_TOOLCHAIN_FILE cmake variable is marked as cached
17 because '-D' options are cache entries themselves.
19 Upstream-Status: Inappropriate [oe-core specific]
20 Signed-off-by: Cody P Schafer <dev@codyps.com>
22 Modules/CMakeDetermineSystem.cmake | 7 +++++++
23 1 file changed, 7 insertions(+)
25 diff --git a/Modules/CMakeDetermineSystem.cmake b/Modules/CMakeDetermineSystem.cmake
26 index f34ec5d61..bcac3ef16 100644
27 --- a/Modules/CMakeDetermineSystem.cmake
28 +++ b/Modules/CMakeDetermineSystem.cmake
29 @@ -74,6 +74,13 @@ else()
33 +if(NOT DEFINED CMAKE_TOOLCHAIN_FILE)
34 + if(DEFINED ENV{OE_CMAKE_TOOLCHAIN_FILE})
35 + set(CMAKE_TOOLCHAIN_FILE "$ENV{OE_CMAKE_TOOLCHAIN_FILE}" CACHE FILEPATH "toolchain file")
36 + message(STATUS "Toolchain file defaulted to '${CMAKE_TOOLCHAIN_FILE}'")
40 # if a toolchain file is used, the user wants to cross compile.
41 # in this case read the toolchain file and keep the CMAKE_HOST_SYSTEM_*
42 # variables around so they can be used in CMakeLists.txt.