diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py index 1fc936a11..5a0661c23 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 8227340fd..837681c3e 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)