Kaydet (Commit) d4801c45 authored tarafından Markus Mohrhard's avatar Markus Mohrhard Kaydeden (comit) Markus Mohrhard

add the cxx flags to the ide parser

Change-Id: Ied5f8ec9af69365e3375de26d325984c57327460
Reviewed-on: https://gerrit.libreoffice.org/10819Reviewed-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
üst f70f4e99
...@@ -25,14 +25,15 @@ class GbuildParserState: ...@@ -25,14 +25,15 @@ class GbuildParserState:
self.include = [] self.include = []
self.defs = {} self.defs = {}
self.cxxobjects = [] self.cxxobjects = []
self.cxxflags = []
self.linked_libs = [] self.linked_libs = []
self.include_sys = [] self.include_sys = []
class GbuildLinkTarget: class GbuildLinkTarget:
def __init__(self, name, location, include, include_sys, defs, cxxobjects, linked_libs): def __init__(self, name, location, include, include_sys, defs, cxxobjects, cxxflags, linked_libs):
(self.name, self.location, self.include, self.include_sys, self.defs, self.cxxobjects, self.linked_libs) = ( (self.name, self.location, self.include, self.include_sys, self.defs, self.cxxobjects, self.cxxflags, self.linked_libs) = (
name, location, include, include_sys, defs, cxxobjects, linked_libs) name, location, include, include_sys, defs, cxxobjects, cxxflags, linked_libs)
def short_name(self): def short_name(self):
return self.name return self.name
...@@ -41,13 +42,14 @@ class GbuildLinkTarget: ...@@ -41,13 +42,14 @@ class GbuildLinkTarget:
return not self.include and not self.defs and not self.cxxobjects and not self.linked_libs return not self.include and not self.defs and not self.cxxobjects and not self.linked_libs
def __str__(self): def __str__(self):
return '%s at %s with include path: %s, isystem includes: %s, defines %s, objects: %s and linked libs: %s' % ( return '%s at %s with include path: %s, isystem includes: %s, defines: %s, objects: %s, cxxflags: %s and linked libs: %s' % (
self.short_name(), self.location, self.include, self.include_sys, self.defs, self.cxxobjects, self.linked_libs) self.short_name(), self.location, self.include, self.include_sys, self.defs, self.cxxobjects,
self.cxxflags, self.linked_libs)
class GbuildLib(GbuildLinkTarget): class GbuildLib(GbuildLinkTarget):
def __init__(self, name, library, location, include, include_sys, defs, cxxobjects, linked_libs): def __init__(self, name, library, location, include, include_sys, defs, cxxobjects, cxxflags, linked_libs):
GbuildLinkTarget.__init__(self, name, location, include, include_sys, defs, cxxobjects, linked_libs) GbuildLinkTarget.__init__(self, name, location, include, include_sys, defs, cxxobjects, cxxflags, linked_libs)
self.library = library self.library = library
def short_name(self): def short_name(self):
...@@ -62,8 +64,8 @@ class GbuildLib(GbuildLinkTarget): ...@@ -62,8 +64,8 @@ class GbuildLib(GbuildLinkTarget):
class GbuildExe(GbuildLinkTarget): class GbuildExe(GbuildLinkTarget):
def __init__(self, name, executable, location, include, include_sys, defs, cxxobjects, linked_libs): def __init__(self, name, executable, location, include, include_sys, defs, cxxobjects, cxxflags, linked_libs):
GbuildLinkTarget.__init__(self, name, location, include, include_sys, defs, cxxobjects, linked_libs) GbuildLinkTarget.__init__(self, name, location, include, include_sys, defs, cxxobjects, cxxflags, linked_libs)
self.executable = executable self.executable = executable
def short_name(self): def short_name(self):
...@@ -91,6 +93,7 @@ class GbuildParser: ...@@ -91,6 +93,7 @@ class GbuildParser:
cxxpattern = re.compile('# CXXOBJECTS := (.*)') cxxpattern = re.compile('# CXXOBJECTS := (.*)')
linkedlibspattern = re.compile('# LINKED_LIBS := (.*)') linkedlibspattern = re.compile('# LINKED_LIBS := (.*)')
ilibpattern = re.compile('# ILIBTARGET := (.*)') ilibpattern = re.compile('# ILIBTARGET := (.*)')
warningpattern = re.compile('-W\S+')
def __init__(self): def __init__(self):
(self.makecmd, self.srcdir, self.builddir, self.instdir, self.libs, (self.makecmd, self.srcdir, self.builddir, self.instdir, self.libs,
...@@ -150,7 +153,7 @@ class GbuildParser: ...@@ -150,7 +153,7 @@ class GbuildParser:
self.libs.append( self.libs.append(
GbuildLib(libmatch.group(2), libname, libmatch.group(1), GbuildLib(libmatch.group(2), libname, libmatch.group(1),
state.include, state.include_sys, state.defs, state.cxxobjects, state.include, state.include_sys, state.defs, state.cxxobjects,
state.linked_libs)) state.cxxflags, state.linked_libs))
state = GbuildParserState() state = GbuildParserState()
continue continue
exematch = GbuildParser.exepattern.match(line) exematch = GbuildParser.exepattern.match(line)
...@@ -159,7 +162,7 @@ class GbuildParser: ...@@ -159,7 +162,7 @@ class GbuildParser:
self.exes.append( self.exes.append(
GbuildExe(exematch.group(2), exename, exematch.group(1), GbuildExe(exematch.group(2), exename, exematch.group(1),
state.include, state.include_sys, state.defs, state.cxxobjects, state.include, state.include_sys, state.defs, state.cxxobjects,
state.linked_libs)) state.cxxflags, state.linked_libs))
state = GbuildParserState() state = GbuildParserState()
continue continue
includematch = GbuildParser.includepattern.match(line) includematch = GbuildParser.includepattern.match(line)
...@@ -190,6 +193,10 @@ class GbuildParser: ...@@ -190,6 +193,10 @@ class GbuildParser:
ilibmatch = GbuildParser.ilibpattern.match(line) ilibmatch = GbuildParser.ilibpattern.match(line)
if ilibmatch: if ilibmatch:
state.ilib = os.path.basename(ilibmatch.group(1)) state.ilib = os.path.basename(ilibmatch.group(1))
continue
if line.find('# T_CXXFLAGS :=') == 0:
state.cxxflags = [cxxflag.strip() for cxxflag in GbuildParser.warningpattern.sub('', line.replace('# T_CXXFLAGS :=','')).split(' ') if len(cxxflag) > 1]
continue
#we could match a lot of other stuff here if needed for integration rpaths etc. #we could match a lot of other stuff here if needed for integration rpaths etc.
return self return self
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment