From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from thoth.sbs.de (thoth.sbs.de [192.35.17.2]) by mail.openembedded.org (Postfix) with ESMTP id BBACE794C4 for ; Fri, 24 Aug 2018 12:33:49 +0000 (UTC) Received: from mail2.siemens.de (mail2.siemens.de [139.25.208.11]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id w7OCXoIh011237 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 24 Aug 2018 14:33:50 +0200 Received: from dev.vm6.ccp.siemens.com (MD1FZU9C.ad001.siemens.net [139.16.79.208]) by mail2.siemens.de (8.15.2/8.15.2) with ESMTP id w7OCXnXk011538; Fri, 24 Aug 2018 14:33:49 +0200 Received: from dev.vm6.ccp.siemens.com (localhost [127.0.0.1]) by dev.vm6.ccp.siemens.com (Postfix) with ESMTP id B6BD410D3F8A; Fri, 24 Aug 2018 14:33:52 +0200 (CEST) From: Pascal Bach To: openembedded-core@lists.openembedded.org Date: Fri, 24 Aug 2018 14:33:46 +0200 Message-Id: <20180824123346.8602-1-pascal.bach@siemens.com> X-Mailer: git-send-email 2.11.0 Subject: [PATCH] cmake: add CMAKE_SYSROOT to generated toolchain file X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Aug 2018 12:33:51 -0000 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 "` 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. Signed-off-by: Pascal Bach --- meta/classes/cmake.bbclass | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass index fd40a9863e..251ddd9afe 100644 --- a/meta/classes/cmake.bbclass +++ b/meta/classes/cmake.bbclass @@ -64,9 +64,12 @@ def map_target_arch_to_uname_arch(target_arch): return "ppc64" return target_arch + cmake_do_generate_toolchain_file() { if [ "${BUILD_SYS}" = "${HOST_SYS}" ]; then cmake_crosscompiling="set( CMAKE_CROSSCOMPILING FALSE )" + else + cmake_sysroot="set( CMAKE_SYSROOT \"${RECIPE_SYSROOT}\" )" fi cat > ${WORKDIR}/toolchain.cmake <