diff options
| author | Jan200101 <sentrycraft123@gmail.com> | 2023-11-21 08:42:56 +0100 |
|---|---|---|
| committer | Eli Schwartz <eschwartz93@gmail.com> | 2023-12-02 19:51:44 -0500 |
| commit | 9016e6958bb83feb9a724f20d8badb116bf7c5f2 (patch) | |
| tree | bac834a4fa993df9bba03e97da56b9cd1bed1abd /mesonbuild/utils/universal.py | |
| parent | a85353cd8326175e719b913ff9aa46e3daf20497 (diff) | |
| download | meson-9016e6958bb83feb9a724f20d8badb116bf7c5f2.tar.gz | |
Only convert boolean values for cmake formats
This caused a regression with mesondefine where
`conf_data.set("FOO", true)`
turned into
`#define FOO 1`
instead of
`#define FOO`
Diffstat (limited to 'mesonbuild/utils/universal.py')
| -rw-r--r-- | mesonbuild/utils/universal.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/utils/universal.py b/mesonbuild/utils/universal.py index 26194628c..93e64c0a2 100644 --- a/mesonbuild/utils/universal.py +++ b/mesonbuild/utils/universal.py @@ -1210,7 +1210,7 @@ def do_replacement(regex: T.Pattern[str], line: str, var, _ = confdata.get(varname) if isinstance(var, str): var_str = var - elif isinstance(var, bool): + elif variable_format.startswith("cmake") and isinstance(var, bool): var_str = str(int(var)) elif isinstance(var, int): var_str = str(var) |
