diff options
author | Chen Qi <Qi.Chen@windriver.com> | 2023-08-21 19:14:25 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-08-29 09:41:07 +0100 |
commit | 026fe2b8e003c4f8709c2c96668509e5b48bc024 (patch) | |
tree | 2e03d695dd289d6378f34521a7c39ec22a134a08 | |
parent | da67e9e9cd18d28852f6ec9e82eb50e0dd1093e3 (diff) | |
download | poky-026fe2b8e003c4f8709c2c96668509e5b48bc024.tar.gz |
cmake: drop OE specific environment variable support
CMAKE_TOOLCHAIN_FILE is now also a supported environment
variable, we can export it directly. There's no need to
use a OE specific patch to add OE_CMAKE_TOOLCHAIN_FILE
support.
(From OE-Core rev: b061149ad06ff3b9d30de0bbd2b698c711a241c7)
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
4 files changed, 1 insertions, 47 deletions
diff --git a/meta/recipes-devtools/cmake/cmake-native_3.26.4.bb b/meta/recipes-devtools/cmake/cmake-native_3.26.4.bb index 2177aa81a4..26a3331cb0 100644 --- a/meta/recipes-devtools/cmake/cmake-native_3.26.4.bb +++ b/meta/recipes-devtools/cmake/cmake-native_3.26.4.bb | |||
@@ -5,7 +5,6 @@ DEPENDS += "bzip2-replacement-native xz-native zlib-native ncurses-native zstd-n | |||
5 | 5 | ||
6 | SRC_URI += "file://OEToolchainConfig.cmake \ | 6 | SRC_URI += "file://OEToolchainConfig.cmake \ |
7 | file://environment.d-cmake.sh \ | 7 | file://environment.d-cmake.sh \ |
8 | file://0001-CMakeDetermineSystem-use-oe-environment-vars-to-load.patch \ | ||
9 | file://0005-Disable-use-of-ext2fs-ext2_fs.h-by-cmake-s-internal-.patch \ | 8 | file://0005-Disable-use-of-ext2fs-ext2_fs.h-by-cmake-s-internal-.patch \ |
10 | file://0001-CMakeLists.txt-disable-USE_NGHTTP2.patch \ | 9 | file://0001-CMakeLists.txt-disable-USE_NGHTTP2.patch \ |
11 | " | 10 | " |
diff --git a/meta/recipes-devtools/cmake/cmake/0001-CMakeDetermineSystem-use-oe-environment-vars-to-load.patch b/meta/recipes-devtools/cmake/cmake/0001-CMakeDetermineSystem-use-oe-environment-vars-to-load.patch deleted file mode 100644 index d13c367e78..0000000000 --- a/meta/recipes-devtools/cmake/cmake/0001-CMakeDetermineSystem-use-oe-environment-vars-to-load.patch +++ /dev/null | |||
@@ -1,44 +0,0 @@ | |||
1 | From 5acfcb2aba1a5641d390558fdf288373f5e39cb5 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 | ||
5 | toolchain file in sdk | ||
6 | |||
7 | Passing the toolchain by: | ||
8 | |||
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). | ||
12 | |||
13 | The OE_CMAKE_TOOLCHAIN_FILE variable is only used as a default if no | ||
14 | toolchain is explicitly specified. | ||
15 | |||
16 | Setting the CMAKE_TOOLCHAIN_FILE cmake variable is marked as cached | ||
17 | because '-D' options are cache entries themselves. | ||
18 | |||
19 | Upstream-Status: Inappropriate [oe-core specific] | ||
20 | Signed-off-by: Cody P Schafer <dev@codyps.com> | ||
21 | Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> | ||
22 | |||
23 | --- | ||
24 | Modules/CMakeDetermineSystem.cmake | 7 +++++++ | ||
25 | 1 file changed, 7 insertions(+) | ||
26 | |||
27 | diff --git a/Modules/CMakeDetermineSystem.cmake b/Modules/CMakeDetermineSystem.cmake | ||
28 | index 2c2c2ac3..fae4f97f 100644 | ||
29 | --- a/Modules/CMakeDetermineSystem.cmake | ||
30 | +++ b/Modules/CMakeDetermineSystem.cmake | ||
31 | @@ -112,6 +112,13 @@ else() | ||
32 | endif() | ||
33 | endif() | ||
34 | |||
35 | +if(NOT DEFINED CMAKE_TOOLCHAIN_FILE) | ||
36 | + if(DEFINED ENV{OE_CMAKE_TOOLCHAIN_FILE}) | ||
37 | + set(CMAKE_TOOLCHAIN_FILE "$ENV{OE_CMAKE_TOOLCHAIN_FILE}" CACHE FILEPATH "toolchain file") | ||
38 | + message(STATUS "Toolchain file defaulted to '${CMAKE_TOOLCHAIN_FILE}'") | ||
39 | + endif() | ||
40 | +endif() | ||
41 | + | ||
42 | # if a toolchain file is used, the user wants to cross compile. | ||
43 | # in this case read the toolchain file and keep the CMAKE_HOST_SYSTEM_* | ||
44 | # variables around so they can be used in CMakeLists.txt. | ||
diff --git a/meta/recipes-devtools/cmake/cmake/environment.d-cmake.sh b/meta/recipes-devtools/cmake/cmake/environment.d-cmake.sh index 7bdb19fb6c..c94b6bb3e3 100644 --- a/meta/recipes-devtools/cmake/cmake/environment.d-cmake.sh +++ b/meta/recipes-devtools/cmake/cmake/environment.d-cmake.sh | |||
@@ -1,2 +1,2 @@ | |||
1 | export OE_CMAKE_TOOLCHAIN_FILE="$OECORE_NATIVE_SYSROOT/usr/share/cmake/OEToolchainConfig.cmake" | 1 | export CMAKE_TOOLCHAIN_FILE="$OECORE_NATIVE_SYSROOT/usr/share/cmake/OEToolchainConfig.cmake" |
2 | export OE_CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX="`echo $OECORE_BASELIB | sed -e s/lib//`" | 2 | export OE_CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX="`echo $OECORE_BASELIB | sed -e s/lib//`" |
diff --git a/meta/recipes-devtools/cmake/cmake_3.26.4.bb b/meta/recipes-devtools/cmake/cmake_3.26.4.bb index bb7ed83e30..ae29a3a945 100644 --- a/meta/recipes-devtools/cmake/cmake_3.26.4.bb +++ b/meta/recipes-devtools/cmake/cmake_3.26.4.bb | |||
@@ -9,7 +9,6 @@ SRC_URI:append:class-nativesdk = " \ | |||
9 | file://SDKToolchainConfig.cmake.template \ | 9 | file://SDKToolchainConfig.cmake.template \ |
10 | file://cmake-setup.py \ | 10 | file://cmake-setup.py \ |
11 | file://environment.d-cmake.sh \ | 11 | file://environment.d-cmake.sh \ |
12 | file://0001-CMakeDetermineSystem-use-oe-environment-vars-to-load.patch \ | ||
13 | " | 12 | " |
14 | 13 | ||
15 | LICENSE:append = " & BSD-1-Clause & MIT" | 14 | LICENSE:append = " & BSD-1-Clause & MIT" |