mirror of
https://git.yoctoproject.org/poky
synced 2026-10-23 19:38:18 +00:00
Patch the location in cmake where the toolchain file is loaded to use the (new) OE_CMAKE_TOOLCHAIN_FILE variable to select a default toolchain if no toolchain has been specified. The cmake alias is removed. The alternatives: - shell alias fails when cmake is called indirectly (ex: a makefile managing several projects which calls cmake for some of them) because aliases are not inherited - wrapper script that unconditionally adds "-D..." breaks cmake's build tests and many other things as it causes cmake to believe it should be configuring things when it should not be. For example, `cmake -DCMAKE_TOOLCHAIN_FILE=... --build .` does not work (note that this also breaks people directly using `cmake --build .` with the current alias). (From OE-Core rev: da60be3768e7183794d63548166d107dbd0a4973) Signed-off-by: Cody P Schafer <dev@codyps.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
53 lines
1.5 KiB
BlitzBasic
53 lines
1.5 KiB
BlitzBasic
require cmake.inc
|
|
|
|
inherit cmake
|
|
|
|
DEPENDS += "curl expat zlib libarchive xz ncurses bzip2"
|
|
|
|
SRC_URI_append_class-nativesdk = " \
|
|
file://OEToolchainConfig.cmake \
|
|
file://environment.d-cmake.sh \
|
|
file://0001-CMakeDetermineSystem-use-oe-environment-vars-to-load.patch \
|
|
"
|
|
|
|
# Strip ${prefix} from ${docdir}, set result into docdir_stripped
|
|
python () {
|
|
prefix=d.getVar("prefix")
|
|
docdir=d.getVar("docdir")
|
|
|
|
if not docdir.startswith(prefix):
|
|
bb.fatal('docdir must contain prefix as its prefix')
|
|
|
|
docdir_stripped = docdir[len(prefix):]
|
|
if len(docdir_stripped) > 0 and docdir_stripped[0] == '/':
|
|
docdir_stripped = docdir_stripped[1:]
|
|
|
|
d.setVar("docdir_stripped", docdir_stripped)
|
|
}
|
|
|
|
EXTRA_OECMAKE=" \
|
|
-DCMAKE_DOC_DIR=${docdir_stripped}/cmake-${CMAKE_MAJOR_VERSION} \
|
|
-DCMAKE_USE_SYSTEM_LIBRARIES=1 \
|
|
-DCMAKE_USE_SYSTEM_LIBRARY_JSONCPP=0 \
|
|
-DCMAKE_USE_SYSTEM_LIBRARY_LIBUV=0 \
|
|
-DCMAKE_USE_SYSTEM_LIBRARY_LIBRHASH=0 \
|
|
-DKWSYS_CHAR_IS_SIGNED=1 \
|
|
-DBUILD_CursesDialog=0 \
|
|
-DKWSYS_LFS_WORKS=1 \
|
|
"
|
|
|
|
do_install_append_class-nativesdk() {
|
|
mkdir -p ${D}${datadir}/cmake
|
|
install -m 644 ${WORKDIR}/OEToolchainConfig.cmake ${D}${datadir}/cmake/
|
|
|
|
mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d
|
|
install -m 644 ${WORKDIR}/environment.d-cmake.sh ${D}${SDKPATHNATIVE}/environment-setup.d/cmake.sh
|
|
}
|
|
|
|
FILES_${PN}_append_class-nativesdk = " ${SDKPATHNATIVE}"
|
|
|
|
FILES_${PN} += "${datadir}/cmake-${CMAKE_MAJOR_VERSION}"
|
|
FILES_${PN}-doc += "${docdir}/cmake-${CMAKE_MAJOR_VERSION}"
|
|
|
|
BBCLASSEXTEND = "nativesdk"
|