mirror of
https://github.com/godotengine/godot-cpp.git
synced 2026-01-03 18:09:13 +03:00
Merge pull request #1714 from dsnopek/extension-api-precision
Check that precision of `extension_api.json` matches build options
This commit is contained in:
@@ -290,10 +290,15 @@ def generate_bindings(api_filepath, use_template_get_node, bits="64", precision=
|
||||
api = {}
|
||||
with open(api_filepath, encoding="utf-8") as api_file:
|
||||
api = json.load(api_file)
|
||||
_generate_bindings(api, use_template_get_node, bits, precision, output_dir)
|
||||
_generate_bindings(api, api_filepath, use_template_get_node, bits, precision, output_dir)
|
||||
|
||||
|
||||
def _generate_bindings(api, use_template_get_node, bits="64", precision="single", output_dir="."):
|
||||
def _generate_bindings(api, api_filepath, use_template_get_node, bits="64", precision="single", output_dir="."):
|
||||
if "precision" in api["header"] and precision != api["header"]["precision"]:
|
||||
raise Exception(
|
||||
f"Cannot do a precision={precision} build using '{api_filepath}' which was generated by Godot built with precision={api['header']['precision']}"
|
||||
)
|
||||
|
||||
target_dir = Path(output_dir) / "gen"
|
||||
|
||||
shutil.rmtree(target_dir, ignore_errors=True)
|
||||
|
||||
Reference in New Issue
Block a user