diff options
-rw-r--r-- | backends.py | 10 | ||||
-rw-r--r-- | coredata.py | 1 | ||||
-rwxr-xr-x | meson.py | 2 | ||||
-rwxr-xr-x | mesongui.py | 13 |
4 files changed, 23 insertions, 3 deletions
diff --git a/backends.py b/backends.py index 203fe86..609f25a 100644 --- a/backends.py +++ b/backends.py @@ -155,7 +155,7 @@ class Backend(): self.generate_custom_generator_rules(target, outfile) outname = self.get_target_filename(target) obj_list = [] - if target.has_pch(): + if self.environment.coredata.use_pch and target.has_pch(): self.generate_pch(target, outfile) header_deps = gen_other_deps for genlist in target.get_generated_sources(): @@ -737,7 +737,10 @@ class NinjaBackend(Backend): rel_obj = os.path.join(self.get_target_private_dir(target), os.path.basename(src_filename)) rel_obj += '.' + self.environment.get_object_suffix() dep_file = rel_obj + '.' + compiler.get_depfile_suffix() - pchlist = target.get_pch(compiler.language) + if self.environment.coredata.use_pch: + pchlist = target.get_pch(compiler.language) + else: + pchlist = [] if len(pchlist) == 0: pch_dep = [] else: @@ -754,7 +757,8 @@ class NinjaBackend(Backend): sarg = compiler.get_include_arg(fulldir) commands.append(barg) commands.append(sarg) - commands += self.get_pch_include_args(compiler, target) + if self.environment.coredata.use_pch: + commands += self.get_pch_include_args(compiler, target) crstr = '' if target.is_cross: crstr = '_CROSS' diff --git a/coredata.py b/coredata.py index 366e41a..5ba54c6 100644 --- a/coredata.py +++ b/coredata.py @@ -34,6 +34,7 @@ class CoreData(): self.backend = options.backend self.buildtype = options.buildtype self.strip = options.strip + self.use_pch = options.use_pch self.coverage = options.coverage if options.cross_file is not None: self.cross_file = os.path.join(os.getcwd(), options.cross_file) @@ -58,6 +58,8 @@ parser.add_option('--strip', action='store_true', dest='strip', default=False,\ help='strip targets on install (default: %default)') parser.add_option('--enable-gcov', action='store_true', dest='coverage', default=False,\ help='measure test coverage') +parser.add_option('--disable-pch', action='store_false', dest='use_pch', default=True,\ + help='do not use precompiled headers') parser.add_option('--cross-file', default=None, dest='cross_file', help='file describing cross compilation environment') diff --git a/mesongui.py b/mesongui.py index 9d13e19..7d97028 100755 --- a/mesongui.py +++ b/mesongui.py @@ -245,11 +245,17 @@ class OptionForm: combo.currentTextChanged.connect(self.build_type_changed) self.form.addRow('Build type', combo) strip = QCheckBox("") + strip.setChecked(self.coredata.strip) strip.stateChanged.connect(self.strip_changed) self.form.addRow('Strip on install', strip) coverage = QCheckBox("") + coverage.setChecked(self.coredata.coverage) coverage.stateChanged.connect(self.coverage_changed) self.form.addRow('Enable coverage', coverage) + pch = QCheckBox("") + pch.setChecked(self.coredata.use_pch) + pch.stateChanged.connect(self.pch_changed) + self.form.addRow('Enable pch', pch) def build_type_changed(self, newtype): self.coredata.buildtype = newtype @@ -268,6 +274,13 @@ class OptionForm: ns = True self.coredata.coverage = ns + def pch_changed(self, newState): + if newState == 0: + ns = False + else: + ns = True + self.coredata.use_pch = ns + class ProcessRunner(): def __init__(self, rundir, cmdlist): self.cmdlist = cmdlist |