do not repeat magic regexes for cmake define replacements
We already have this magic string in mesonlib, and this should always have used the cmake@ format which is identical to the meson format other than the regex.
This commit is contained in:
parent
f4b91c4306
commit
9ec3b99a4f
|
@ -310,10 +310,10 @@ class CmakeModule(ExtensionModule):
|
|||
raise mesonlib.MesonException(f'Could not read input file {infile}: {e!s}')
|
||||
|
||||
result = []
|
||||
regex = re.compile(r'(?:\\\\)+(?=\\?@)|\\@|@([-a-zA-Z0-9_]+)@')
|
||||
regex = mesonlib.get_variable_regex('cmake@')
|
||||
for line in data:
|
||||
line = line.replace('@PACKAGE_INIT@', package_init)
|
||||
line, _missing = mesonlib.do_replacement(regex, line, 'meson', confdata)
|
||||
line, _missing = mesonlib.do_replacement(regex, line, 'cmake@', confdata)
|
||||
|
||||
result.append(line)
|
||||
|
||||
|
|
Loading…
Reference in New Issue