summaryrefslogtreecommitdiffstats
path: root/meta/classes-recipe
diff options
context:
space:
mode:
authorPascal Bach <pascal.bach@siemens.com>2023-04-21 12:39:47 +0530
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-04-27 14:41:31 +0100
commitcce022a50770faca2125333996d053762f005e20 (patch)
tree055cd2996bf1d93a66a4dda7785b5b0a1eb16095 /meta/classes-recipe
parenta83f1f289d3cfc86beea3f874a9e8152cc498551 (diff)
downloadpoky-cce022a50770faca2125333996d053762f005e20.tar.gz
cmake: add CMAKE_SYSROOT to generated toolchain file
This already got fixed in the toolchain file that is used during development in https://github.com/openembedded/openembedded-core/commit/cb42802f2fe1760f894a435b07286bca3a220364 The toolchain file generated by the cmake.bbclass however does not set CMAKE_SYSROOT. Under certain circumstances this also leads to the error: `"stdlib.h: No such file or directory #include_next <stdlib.h>"` during the build of a recipe. An example where this accured was during the upgrade of the Apache Thrift recipe in meta-openembedded to 0.11.0. With this change the build works out of the box. CMAKE_SYSROOT must only be set when crosscompiling, otherwise it will interfere with the native compiler headers. (From OE-Core rev: eb51e30e17c0c98441583854e8f8632e4fb5d11c) Signed-off-by: Pascal Bach <pascal.bach@siemens.com> (from http://lists.openembedded.org/pipermail/openembedded-core/2018-August/154791.html ) Signed-off-by: Mikko Rapeli <mikko.rapeli@bmw.de> Signed-off-by: Poonam Jadhav <poonam.jadhav@kpit.com> Signed-off-by: Poonam Jadhav <ppjadhav456@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes-recipe')
-rw-r--r--meta/classes-recipe/cmake.bbclass4
1 files changed, 4 insertions, 0 deletions
diff --git a/meta/classes-recipe/cmake.bbclass b/meta/classes-recipe/cmake.bbclass
index 554b948c32..301367b515 100644
--- a/meta/classes-recipe/cmake.bbclass
+++ b/meta/classes-recipe/cmake.bbclass
@@ -94,6 +94,8 @@ def map_host_arch_to_uname_arch(host_arch):
94cmake_do_generate_toolchain_file() { 94cmake_do_generate_toolchain_file() {
95 if [ "${BUILD_SYS}" = "${HOST_SYS}" ]; then 95 if [ "${BUILD_SYS}" = "${HOST_SYS}" ]; then
96 cmake_crosscompiling="set( CMAKE_CROSSCOMPILING FALSE )" 96 cmake_crosscompiling="set( CMAKE_CROSSCOMPILING FALSE )"
97 else
98 cmake_sysroot="set( CMAKE_SYSROOT \"${RECIPE_SYSROOT}\" )"
97 fi 99 fi
98 cat > ${WORKDIR}/toolchain.cmake <<EOF 100 cat > ${WORKDIR}/toolchain.cmake <<EOF
99# CMake system name must be something like "Linux". 101# CMake system name must be something like "Linux".
@@ -126,6 +128,8 @@ set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
126set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY ) 128set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )
127set( CMAKE_PROGRAM_PATH "/" ) 129set( CMAKE_PROGRAM_PATH "/" )
128 130
131$cmake_sysroot
132
129# Use qt.conf settings 133# Use qt.conf settings
130set( ENV{QT_CONF_PATH} ${WORKDIR}/qt.conf ) 134set( ENV{QT_CONF_PATH} ${WORKDIR}/qt.conf )
131 135