aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/compilers.py2
-rw-r--r--mesonbuild/coredata.py3
2 files changed, 4 insertions, 1 deletions
diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py
index 1fc936a..5a0661c 100644
--- a/mesonbuild/compilers.py
+++ b/mesonbuild/compilers.py
@@ -116,7 +116,7 @@ msvc_winlibs = ['kernel32.lib', 'user32.lib', 'gdi32.lib',
base_options = {
- 'b_pch': coredata.UserBooleanOption('b_pch', 'Use precompiled headers', False),
+ 'b_pch': coredata.UserBooleanOption('b_pch', 'Use precompiled headers', True),
'b_lto': coredata.UserBooleanOption('b_lto', 'Use link time optimization', False),
'b_sanitize': coredata.UserComboOption('b_sanitize',
'Code sanitizer to use',
diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py
index 8227340..837681c 100644
--- a/mesonbuild/coredata.py
+++ b/mesonbuild/coredata.py
@@ -69,6 +69,9 @@ class UserBooleanOption(UserOption):
return True
raise MesonException('Value "%s" for boolean option "%s" is not a boolean.' % (valuestring, self.name))
+ def __bool__(self):
+ return self.value
+
class UserComboOption(UserOption):
def __init__(self, name, description, choices, value):
super().__init__(name, description, choices)