eclass/cmake: Sync with Gentoo

It's from Gentoo commit c9a840065a2553871dd298e933da2874bf26062b.
This commit is contained in:
Flatcar Buildbot 2023-03-20 07:23:55 +00:00
parent bd90dc4fae
commit a7e2ed12df

View File

@ -20,7 +20,7 @@
case ${EAPI} in case ${EAPI} in
7|8) ;; 7|8) ;;
*) die "${ECLASS}: EAPI=${EAPI:-0} is not supported" ;; *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac esac
if [[ -z ${_CMAKE_ECLASS} ]]; then if [[ -z ${_CMAKE_ECLASS} ]]; then
@ -489,7 +489,7 @@ cmake_src_configure() {
# When cross-compiling with a sysroot (e.g. with crossdev's emerge wrappers) # 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. # we need to tell cmake to use libs/headers from the sysroot but programs from / only.
cat >> "${toolchain_file}" <<- _EOF_ || die cat >> "${toolchain_file}" <<- _EOF_ || die
set(CMAKE_FIND_ROOT_PATH "${SYSROOT}") set(CMAKE_SYSROOT "${ESYSROOT}")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)