diff options
-rwxr-xr-x | bin/gbuild-to-ide | 7 | ||||
-rwxr-xr-x | bin/gbuild-to-ideNS | 7 |
2 files changed, 12 insertions, 2 deletions
diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide index 0ff7579e1c84..d50801c3e6ca 100755 --- a/bin/gbuild-to-ide +++ b/bin/gbuild-to-ide @@ -67,10 +67,15 @@ class GbuildParser: defs = {} alldefs = [defswitch.strip() for defswitch in defsline.strip().lstrip('-D').split(' -D') if len(defswitch) > 2] for d in alldefs: - defparts = d.split('=') + dparts = d.split(' -U') + """after dparts.pop(0), dparts will contain only undefs""" + defparts = dparts.pop(0).strip().split('=') if len(defparts) == 1: defparts.append(None) defs[defparts[0]] = defparts[1] + """Drop undefed items (if any) from previous defs""" + for u in dparts: + defs.pop(u.strip(), '') defs["LIBO_INTERNAL_ONLY"] = None return defs diff --git a/bin/gbuild-to-ideNS b/bin/gbuild-to-ideNS index 44970c466b77..5fca58cf227d 100755 --- a/bin/gbuild-to-ideNS +++ b/bin/gbuild-to-ideNS @@ -106,10 +106,15 @@ class GbuildParser: defs = {} alldefs = [defswitch.strip() for defswitch in defsline.strip().lstrip('-D').split(' -D') if len(defswitch) > 2] for d in alldefs: - defparts = d.split('=') + dparts = d.split(' -U') + """after dparts.pop(0), dparts will contain only undefs""" + defparts = dparts.pop(0).strip().split('=') if len(defparts) == 1: defparts.append(None) defs[defparts[0]] = defparts[1] + """Drop undefed items (if any) from previous defs""" + for u in dparts: + defs.pop(u.strip(), '') defs["LIBO_INTERNAL_ONLY"] = None return defs |