Writes python dict to meson config file
(self, arch)
| 1545 | } |
| 1546 | |
| 1547 | def write_build_options(self, arch): |
| 1548 | """Writes python dict to meson config file""" |
| 1549 | option_data = "" |
| 1550 | build_options = self.get_recipe_meson_options(arch) |
| 1551 | for key in build_options.keys(): |
| 1552 | data_chunk = "[{}]".format(key) |
| 1553 | for subkey in build_options[key].keys(): |
| 1554 | value = build_options[key][subkey] |
| 1555 | if isinstance(value, int): |
| 1556 | value = str(value) |
| 1557 | elif isinstance(value, str): |
| 1558 | value = "'{}'".format(value) |
| 1559 | elif isinstance(value, bool): |
| 1560 | value = "true" if value else "false" |
| 1561 | elif isinstance(value, list): |
| 1562 | value = "['" + "', '".join(value) + "']" |
| 1563 | data_chunk += "\n" + subkey + " = " + value |
| 1564 | option_data += data_chunk + "\n\n" |
| 1565 | return option_data |
| 1566 | |
| 1567 | def ensure_args(self, *args): |
| 1568 | for arg in args: |
no test coverage detected