summaryrefslogtreecommitdiffstats
path: root/meta/classes-recipe
diff options
context:
space:
mode:
authorDaniel Klauer <daniel.klauer@gin.de>2024-04-17 13:24:44 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-04-30 22:20:16 +0100
commit17038110118245d35ac395e8e98a22f04953ad8b (patch)
treec993d3ffb99712ec4e335f5d505262e828c6cbc1 /meta/classes-recipe
parent5496c0148725c0dde3223fd6f6a47a5ced41f01b (diff)
downloadpoky-17038110118245d35ac395e8e98a22f04953ad8b.tar.gz
cmake.bbclass: Add ${COREBASE}/scripts to CMAKE_FIND_ROOT_PATH
${COREBASE}/scripts contains a "git" wrapper disabling fakeroot/pseudo. This patch allows CMake to find ${COREBASE}/scripts/git instead of ${HOSTTOOLS_DIR}/git. This is needed for git invocations during do_install, since do_install is a fakeroot task, and otherwise all git commands fail with "fatal: detected dubious ownership in repository ...". I don't know how common it is for CMake projects to invoke git during the install phase intentionally. It's probably more common to do this during the configure phase. However, the install step may re-run the configure step, if some dependencies changed. In my case, this happened in incremental Yocto builds which reran do_install and repopulated parts of the recipe-sysroot during that, without first rerunning do_configure or do_compile. One of the dependencies changed (but only changing a file in some unrelated sub-package of it which was not even installed into the recipe-sysroot), causing the dependant's recipe-sysroot to be repopulated during do_install and thus causing the CMake project to be reconfigured during do_install. (From OE-Core rev: c1d1252032a5f146ad91eafc6f57ab4ea2a72e9c) Signed-off-by: Daniel Klauer <daniel.klauer@gin.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes-recipe')
-rw-r--r--meta/classes-recipe/cmake.bbclass2
1 files changed, 1 insertions, 1 deletions
diff --git a/meta/classes-recipe/cmake.bbclass b/meta/classes-recipe/cmake.bbclass
index 3d3781ef33..e1c3d7ddb5 100644
--- a/meta/classes-recipe/cmake.bbclass
+++ b/meta/classes-recipe/cmake.bbclass
@@ -124,7 +124,7 @@ set( CMAKE_CXX_LINK_FLAGS "${OECMAKE_CXX_LINK_FLAGS}" CACHE STRING "LDFLAGS" )
124 124
125# only search in the paths provided so cmake doesnt pick 125# only search in the paths provided so cmake doesnt pick
126# up libraries and tools from the native build machine 126# up libraries and tools from the native build machine
127set( CMAKE_FIND_ROOT_PATH ${STAGING_DIR_HOST} ${STAGING_DIR_NATIVE} ${CROSS_DIR} ${OECMAKE_PERLNATIVE_DIR} ${OECMAKE_EXTRA_ROOT_PATH} ${EXTERNAL_TOOLCHAIN} ${HOSTTOOLS_DIR}) 127set( CMAKE_FIND_ROOT_PATH ${STAGING_DIR_HOST} ${STAGING_DIR_NATIVE} ${CROSS_DIR} ${OECMAKE_PERLNATIVE_DIR} ${OECMAKE_EXTRA_ROOT_PATH} ${EXTERNAL_TOOLCHAIN} ${COREBASE}/scripts ${HOSTTOOLS_DIR} )
128set( CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY ) 128set( CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY )
129set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ${OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM} ) 129set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ${OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM} )
130set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY ) 130set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )