|
|
@ -273,10 +273,10 @@ def do_mesondefine(line, confdata): |
|
|
|
|
|
|
|
|
|
|
|
def do_conf_file(src, dst, confdata): |
|
|
|
def do_conf_file(src, dst, confdata): |
|
|
|
try: |
|
|
|
try: |
|
|
|
with open(src) as f: |
|
|
|
with open(src, encoding='utf-8') as f: |
|
|
|
data = f.readlines() |
|
|
|
data = f.readlines() |
|
|
|
except Exception: |
|
|
|
except Exception as e: |
|
|
|
raise MesonException('Could not read input file %s.' % src) |
|
|
|
raise MesonException('Could not read input file %s: %s' % (src, str(e))) |
|
|
|
# Only allow (a-z, A-Z, 0-9, _, -) as valid characters for a define |
|
|
|
# Only allow (a-z, A-Z, 0-9, _, -) as valid characters for a define |
|
|
|
# Also allow escaping '@' with '\@' |
|
|
|
# Also allow escaping '@' with '\@' |
|
|
|
regex = re.compile(r'[^\\]?@([-a-zA-Z0-9_]+)@') |
|
|
|
regex = re.compile(r'[^\\]?@([-a-zA-Z0-9_]+)@') |
|
|
|