From 9016e6958bb83feb9a724f20d8badb116bf7c5f2 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Tue, 21 Nov 2023 08:42:56 +0100 Subject: [PATCH] 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` --- mesonbuild/utils/universal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 2.41.0