diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2013-02-08 20:41:13 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2013-02-08 20:41:13 +0200 |
commit | c5b3d913a3cbadbef0f378968db7711d82920295 (patch) | |
tree | 505e1c7d4b2ac3082d2964e390cf733722590f8b /generators.py | |
parent | 3deb31ebd59ededae60100cac768ce8f3e3504fc (diff) | |
download | meson-c5b3d913a3cbadbef0f378968db7711d82920295.zip meson-c5b3d913a3cbadbef0f378968db7711d82920295.tar.gz meson-c5b3d913a3cbadbef0f378968db7711d82920295.tar.bz2 |
Can pickle and load install data object.
Diffstat (limited to 'generators.py')
-rwxr-xr-x | generators.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/generators.py b/generators.py index 173fa7c..9f468fa 100755 --- a/generators.py +++ b/generators.py @@ -14,8 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os, stat, re +import os, stat, re, pickle import interpreter, nodes +from builder_install import InstallData def shell_quote(cmdlist): return ["'" + x + "'" for x in cmdlist] @@ -167,7 +168,14 @@ class NinjaGenerator(Generator): install_data = os.path.join(self.environment.get_scratch_dir(), 'install.dat') outfile.write('build install: CUSTOM_COMMAND | all\n') outfile.write(" COMMAND = '%s' '%s'\n\n" % (ninja_quote(install_script), ninja_quote(install_data))) - + self.generate_install_data(outfile, install_data) + + def generate_install_data(self, outfile, install_data_file): + #d['source_dir'] = self.environment.get_source_dir() + #d['build_dir'] = self.environment.get_build_dir() + d = InstallData(self.environment.get_source_dir(), self.environment.get_build_dir()) + ofile = open(install_data_file, 'wb') + pickle.dump(d, ofile) def generate_tests(self, outfile): script_root = self.get_script_root() @@ -197,7 +205,6 @@ class NinjaGenerator(Generator): rule = 'rule STATIC_LINKER\n' command = ' command = %s $LINK_FLAGS $out $in\n' % \ ' '.join(static_linker.get_exelist()) - description = ' description = Static linking library $out\n\n' outfile.write(rule) outfile.write(command) |