diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2021-10-24 21:03:11 -0400 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2021-10-27 09:59:08 -0400 |
commit | 9ec3b99a4fd61ba928b3534dd18c1abd8e5b09db (patch) | |
tree | 3ba048963696ad397e71e54f7d34065e07b6ac0c /mesonbuild/modules/cmake.py | |
parent | f4b91c4306b68c200a54a53ba872903eed2fcd18 (diff) | |
download | meson-9ec3b99a4fd61ba928b3534dd18c1abd8e5b09db.zip meson-9ec3b99a4fd61ba928b3534dd18c1abd8e5b09db.tar.gz meson-9ec3b99a4fd61ba928b3534dd18c1abd8e5b09db.tar.bz2 |
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.
Diffstat (limited to 'mesonbuild/modules/cmake.py')
-rw-r--r-- | mesonbuild/modules/cmake.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mesonbuild/modules/cmake.py b/mesonbuild/modules/cmake.py index 51ee9ee..76a7b9b 100644 --- a/mesonbuild/modules/cmake.py +++ b/mesonbuild/modules/cmake.py @@ -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) |