diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2014-04-03 00:43:07 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2014-04-03 00:43:07 +0300 |
commit | 6304da8f845913dcf2adbc0dda9fd8f26f494533 (patch) | |
tree | 970fd9707baacca5ab933cce597eb9df6faa6291 /xcodebackend.py | |
parent | b1be0a454701bb76d52b37c7b0f0d519d3751dfe (diff) | |
download | meson-6304da8f845913dcf2adbc0dda9fd8f26f494533.zip meson-6304da8f845913dcf2adbc0dda9fd8f26f494533.tar.gz meson-6304da8f845913dcf2adbc0dda9fd8f26f494533.tar.bz2 |
Some work on using prebuilt object files. Does not work yet.
Diffstat (limited to 'xcodebackend.py')
-rw-r--r-- | xcodebackend.py | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/xcodebackend.py b/xcodebackend.py index 199b366..e2088cf 100644 --- a/xcodebackend.py +++ b/xcodebackend.py @@ -35,7 +35,8 @@ class XCodeBackend(backends.Backend): 'hxx' : 'sourcecode.cpp.h', 'hh' : 'sourcecode.cpp.hh', 'inc' : 'sourcecode.c.h', - 'dylib' : 'compiled.mach-o.dylib'} + 'dylib' : 'compiled.mach-o.dylib', + 'o' : 'compiled.mach-o.objfile',} self.maingroup_id = self.gen_id() self.all_id = self.gen_id() self.all_buildconf_id = self.gen_id() @@ -103,18 +104,26 @@ class XCodeBackend(backends.Backend): self.target_filemap = {} for name, t in self.build.targets.items(): for s in t.sources: - s = os.path.join(t.subdir, s) if isinstance(s, str): + s = os.path.join(t.subdir, s) self.filemap[s] = self.gen_id() + for o in t.objects: + if isinstance(o, str): + o = os.path.join(t.subdir, o) + self.filemap[o] = self.gen_id() self.target_filemap[name] = self.gen_id() def generate_buildmap(self): self.buildmap = {} for t in self.build.targets.values(): for s in t.sources: - s = os.path.join(t.subdir, s) if isinstance(s, str): + s = os.path.join(t.subdir, s) self.buildmap[s] = self.gen_id() + for o in t.objects: + o = os.path.join(t.subdir, o) + if isinstance(o, str): + self.buildmap[o] = self.gen_id() def generate_buildstylemap(self): self.buildstylemap = {'debug' : self.gen_id()} @@ -208,16 +217,24 @@ class XCodeBackend(backends.Backend): def generate_pbx_build_file(self): self.ofile.write('\n/* Begin PBXBuildFile section */\n') templ = '%s /* %s */ = { isa = PBXBuildFile; fileRef = %s /* %s */; settings = { COMPILER_FLAGS = "%s"; }; };\n' + otempl = '%s /* %s */ = { isa = PBXBuildFile; fileRef = %s /* %s */;};\n' for t in self.build.targets.values(): for s in t.sources: - s = os.path.join(t.subdir, s) if isinstance(s, str): + s = os.path.join(t.subdir, s) idval = self.buildmap[s] fullpath = os.path.join(self.environment.get_source_dir(), s) fileref = self.filemap[s] fullpath2 = fullpath compiler_flags = '' self.ofile.write(templ % (idval, fullpath, fileref, fullpath2, compiler_flags)) + for o in t.objects: + o = os.path.join(t.subdir, o) + idval = self.buildmap[o] + fileref = self.filemap[o] + fullpath = os.path.join(self.environment.get_source_dir(), o) + fullpath2 = fullpath + self.ofile.write(otempl % (idval, fullpath, fileref, fullpath2)) self.ofile.write('/* End PBXBuildFile section */\n') def generate_pbx_build_style(self): @@ -350,6 +367,9 @@ class XCodeBackend(backends.Backend): s = os.path.join(self.build.targets[t].subdir, s) if isinstance(s, str): self.write_line('%s /* %s */,' % (self.filemap[s], s)) + for o in self.build.targets[t].objects: + o = os.path.join(self.build.targets[t].subdir, o) + self.write_line('%s /* %s */,' % (self.filemap[o], o)) self.indent_level-=1 self.write_line(');') self.write_line('name = "Source files";') |