Message ID | 20231003010529.2892756-1-pkj@axis.com |
---|---|
State | Accepted, archived |
Commit | 09873b3fb24a00cfbd73282d29e4c5821774f579 |
Headers | show |
Series | [1/3] externalsrc.bbclass: Support specifying patterns in CONFIGURE_FILES | expand |
> -----Original Message----- > From: openembedded-core@lists.openembedded.org <openembedded-core@lists.openembedded.org> On Behalf Of Peter Kjellerstedt > Sent: den 3 oktober 2023 03:05 > To: openembedded-core@lists.openembedded.org > Subject: [OE-core] [PATCH 2/3] cmake.bbclass: Add *.cmake to CONFIGURE_FILES > > This makes do_configure depend on changes to any cmake file when > externalsrc is active. > > Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> > --- > meta/classes-recipe/cmake.bbclass | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/meta/classes-recipe/cmake.bbclass b/meta/classes-recipe/cmake.bbclass > index 41748b0820..d978b88944 100644 > --- a/meta/classes-recipe/cmake.bbclass > +++ b/meta/classes-recipe/cmake.bbclass > @@ -156,7 +156,7 @@ EOF > > addtask generate_toolchain_file after do_patch before do_configure > > -CONFIGURE_FILES = "CMakeLists.txt" > +CONFIGURE_FILES = "CMakeLists.txt *.cmake" > > do_configure[cleandirs] = "${@d.getVar('B') if d.getVar('S') != d.getVar('B') else ''}" > Any reason this was not integrated today together with the other two patches in this series? //Peter
diff --git a/meta/classes/externalsrc.bbclass b/meta/classes/externalsrc.bbclass index cba80bb1d4..a54f316aa0 100644 --- a/meta/classes/externalsrc.bbclass +++ b/meta/classes/externalsrc.bbclass @@ -252,6 +252,8 @@ def srctree_configure_hash_files(d): Get the list of files that should trigger do_configure to re-execute, based on the value of CONFIGURE_FILES """ + import fnmatch + in_files = (d.getVar('CONFIGURE_FILES') or '').split() out_items = [] search_files = [] @@ -263,8 +265,8 @@ def srctree_configure_hash_files(d): if search_files: s_dir = d.getVar('EXTERNALSRC') for root, _, files in os.walk(s_dir): - for f in files: - if f in search_files: + for p in search_files: + for f in fnmatch.filter(files, p): out_items.append('%s:True' % os.path.join(root, f)) return ' '.join(out_items)
This allows, e.g., *.cmake to be added to CONFIGURE_FILES to make the do_configure task depend on changes to any cmake file. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> --- meta/classes/externalsrc.bbclass | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)