From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id E96BE158089 for ; Sat, 16 Sep 2023 15:04:14 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A774D2BC01E; Sat, 16 Sep 2023 15:04:13 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 8AD382BC01C for ; Sat, 16 Sep 2023 15:04:13 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 8474D335D1B for ; Sat, 16 Sep 2023 15:04:12 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 0849C11A2 for ; Sat, 16 Sep 2023 15:04:11 +0000 (UTC) From: "Andreas Sturmlechner" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Andreas Sturmlechner" Message-ID: <1694876606.065572bdc5985f3a481348fb69e0780ee2f7d7ba.asturm@gentoo> Subject: [gentoo-commits] proj/kde:master commit in: eclass/ X-VCS-Repository: proj/kde X-VCS-Files: eclass/cmake.eclass X-VCS-Directories: eclass/ X-VCS-Committer: asturm X-VCS-Committer-Name: Andreas Sturmlechner X-VCS-Revision: 065572bdc5985f3a481348fb69e0780ee2f7d7ba X-VCS-Branch: master Date: Sat, 16 Sep 2023 15:04:11 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 47edc479-6fae-4044-aae5-d38174e1cbfd X-Archives-Hash: 1994b6b548fd8a8b2a2f483e7b1afe0b commit: 065572bdc5985f3a481348fb69e0780ee2f7d7ba Author: Raul E Rangel chromium org> AuthorDate: Wed Apr 19 21:54:01 2023 +0000 Commit: Andreas Sturmlechner gentoo org> CommitDate: Sat Sep 16 15:03:26 2023 +0000 URL: https://gitweb.gentoo.org/proj/kde.git/commit/?id=065572bd cmake.eclass: Set CMAKE_SYSROOT when building with SYSROOT= When performing a SYSROOT= build, the --sysroot parameter was not getting passed to the compiler if the CBUILD and CHOST matched. This results in the build attempting to use BROOT libraries and headers instead of the ones from the SYSROOT. This change will allow `llvm` to be built into a new SYSROOT. ROOT=/build/amd64-host emerge sys-devel/llvm Signed-off-by: Raul E Rangel chromium.org> Closes: https://github.com/gentoo/gentoo/pull/30658 Signed-off-by: James Le Cuirot gentoo.org> Signed-off-by: Andreas Sturmlechner gentoo.org> eclass/cmake.eclass | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/eclass/cmake.eclass b/eclass/cmake.eclass index b7db941bfb..340645e917 100644 --- a/eclass/cmake.eclass +++ b/eclass/cmake.eclass @@ -407,17 +407,17 @@ cmake_src_configure() { cat >> "${toolchain_file}" <<- _EOF_ || die set(CMAKE_SYSTEM_NAME "${sysname}") _EOF_ + fi - if [ "${SYSROOT:-/}" != "/" ] ; then - # When cross-compiling with a sysroot (e.g. with crossdev's emerge wrappers) - # we need to tell cmake to use libs/headers from the sysroot but programs from / only. - cat >> "${toolchain_file}" <<- _EOF_ || die - set(CMAKE_SYSROOT "${ESYSROOT}") - set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) - set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) - set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) - _EOF_ - fi + if [[ ${SYSROOT:-/} != / ]] ; then + # When building with a sysroot (e.g. with crossdev's emerge wrappers) + # we need to tell cmake to use libs/headers from the sysroot but programs from / only. + cat >> "${toolchain_file}" <<- _EOF_ || die + set(CMAKE_SYSROOT "${ESYSROOT}") + set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) + set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) + set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) + _EOF_ fi if use prefix-guest; then