From c4794e76ecbec3833bfac1a476e4ffa79e05b3e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=BCller?= Date: Fri, 11 Sep 2015 14:22:42 +0200 Subject: [PATCH] cmake-lib.bbclass: allow 'ignore' for CMAKE_ALIGN_SYSROOT and describe use-case MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Andreas Müller --- classes/cmake-lib.bbclass | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/classes/cmake-lib.bbclass b/classes/cmake-lib.bbclass index e3b2a8b5..c39cdf8c 100644 --- a/classes/cmake-lib.bbclass +++ b/classes/cmake-lib.bbclass @@ -44,6 +44,16 @@ # # CMAKE_ALIGN_SYSROOT_class-native[] = ", , " # +# Native extended recipe -> no native alignement: +# +# CMAKE_ALIGN_SYSROOT_class-native[] = "ignore" +# CMAKE_ALIGN_SYSROOT[] = ", , " +# +# Native extended recipe -> no cross alignement: +# +# CMAKE_ALIGN_SYSROOT_class-native[] = ", , " +# CMAKE_ALIGN_SYSROOT[] = "ignore" +# # filename for the file containg full names of all cmakefiles staged @@ -58,9 +68,19 @@ def get_align_flags(d): ret = d.getVarFlags("CMAKE_ALIGN_SYSROOT") or {} return ret +# global helper to check CMAKE_ALIGN_SYSROOT array contains 'ignore' +def get_flags_ignore(flags): + if flags and flags.values().count('ignore') > 0: + return True + return False + + # 1. basic checks for CMAKE_ALIGN_SYSROOT python () { cmakehideflags = get_align_flags(d) + if get_flags_ignore(cmakehideflags): + return + pn = d.getVar('PN', True) if cmakehideflags: for flag, flagval in sorted(cmakehideflags.items()): @@ -134,14 +154,16 @@ python do_populate_sysroot_append() { else: bb.fatal("Parameter %s is too short for CMAKE_ALIGN_SYSROOT[%s] in %s" % (param, flag, pn)) - # first check if cmake files were installed to sysroot + cmakehideflags = get_align_flags(d) + if get_flags_ignore(cmakehideflags): + return + + # check if cmake files were installed to sysroot tmpfile = d.getVar('CMAKEINSTALLED', True) if (not os.path.isfile(tmpfile)) or os.path.getsize(tmpfile) == 0: bb.warn("There were no cmake files installed by %s" % pn) else: # parse CMAKE_ALIGN_SYSROOT[..] - cmakehideflags = get_align_flags(d) - for flag, flagval in sorted(cmakehideflags.items()): items = flagval.split(",")