mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-09 14:06:58 +02:00
eclass/cmake: Sync with Gentoo
It's from Gentoo commit b6e2235a3982cad4d74bb7eb49e858835344c3ba.
This commit is contained in:
parent
f02722d477
commit
3759d2bc46
@ -293,6 +293,15 @@ _cmake_check_build_dir() {
|
||||
BUILD_DIR="${CMAKE_USE_DIR}"
|
||||
else
|
||||
: "${BUILD_DIR:=${CMAKE_USE_DIR}_build}"
|
||||
|
||||
# Avoid creating ${WORKDIR}_build (which is above WORKDIR).
|
||||
# TODO: For EAPI > 8, we should ban S=WORKDIR for CMake.
|
||||
# See bug #889420.
|
||||
if [[ ${S} == "${WORKDIR}" && ${BUILD_DIR} == "${WORKDIR}_build" ]] ; then
|
||||
eqawarn "QA notice: S=WORKDIR is deprecated for cmake.eclass."
|
||||
eqawarn "Please relocate the sources in src_unpack."
|
||||
BUILD_DIR="${WORKDIR}"/${P}_build
|
||||
fi
|
||||
fi
|
||||
|
||||
einfo "Source directory (CMAKE_USE_DIR): \"${CMAKE_USE_DIR}\""
|
||||
@ -484,9 +493,10 @@ 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)
|
||||
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}")
|
||||
@ -495,7 +505,6 @@ cmake_src_configure() {
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
_EOF_
|
||||
fi
|
||||
fi
|
||||
|
||||
if use prefix-guest; then
|
||||
cat >> "${build_rules}" <<- _EOF_ || die
|
||||
|
Loading…
Reference in New Issue
Block a user