|
|
@ -1262,7 +1262,7 @@ def get_variable_regex(variable_format: Literal['meson', 'cmake', 'cmake@'] = 'm |
|
|
|
|
|
|
|
|
|
|
|
def do_conf_str(src: str, data: T.List[str], confdata: 'ConfigurationData', |
|
|
|
def do_conf_str(src: str, data: T.List[str], confdata: 'ConfigurationData', |
|
|
|
variable_format: Literal['meson', 'cmake', 'cmake@'], |
|
|
|
variable_format: Literal['meson', 'cmake', 'cmake@'], |
|
|
|
encoding: str = 'utf-8', subproject: T.Optional[SubProject] = None) -> T.Tuple[T.List[str], T.Set[str], bool]: |
|
|
|
subproject: T.Optional[SubProject] = None) -> T.Tuple[T.List[str], T.Set[str], bool]: |
|
|
|
def line_is_valid(line: str, variable_format: str) -> bool: |
|
|
|
def line_is_valid(line: str, variable_format: str) -> bool: |
|
|
|
if variable_format == 'meson': |
|
|
|
if variable_format == 'meson': |
|
|
|
if '#cmakedefine' in line: |
|
|
|
if '#cmakedefine' in line: |
|
|
@ -1307,7 +1307,7 @@ def do_conf_file(src: str, dst: str, confdata: 'ConfigurationData', |
|
|
|
except Exception as e: |
|
|
|
except Exception as e: |
|
|
|
raise MesonException(f'Could not read input file {src}: {e!s}') |
|
|
|
raise MesonException(f'Could not read input file {src}: {e!s}') |
|
|
|
|
|
|
|
|
|
|
|
(result, missing_variables, confdata_useless) = do_conf_str(src, data, confdata, variable_format, encoding, subproject) |
|
|
|
(result, missing_variables, confdata_useless) = do_conf_str(src, data, confdata, variable_format, subproject) |
|
|
|
dst_tmp = dst + '~' |
|
|
|
dst_tmp = dst + '~' |
|
|
|
try: |
|
|
|
try: |
|
|
|
with open(dst_tmp, 'w', encoding=encoding, newline='') as f: |
|
|
|
with open(dst_tmp, 'w', encoding=encoding, newline='') as f: |
|
|
|