Skip to content

[SCons] Fix custom API file/dir relative paths. - #968

Merged
akien-mga merged 1 commit into
godotengine:masterfrom
Faless:build/4.x_custom_paths
Jan 9, 2023
Merged

akien-mga merged 1 commit into
godotengine:masterfrom
Faless:build/4.x_custom_paths

Conversation

@Faless

@Faless Faless commented Dec 19, 2022

Copy link
Copy Markdown
Contributor

Relative paths in custom_api_file and gdextension_dir would be interpreted as relative to the godot-cpp directory instead of the main scons directory as expected.

@Faless Faless added bug This has been identified as a bug topic:buildsystem Related to the buildsystem or CI setup topic:gdextension This relates to the new Godot 4 extension implementation labels Dec 19, 2022
@Faless Faless added this to the 4.0 milestone Dec 19, 2022
@Faless
Faless requested a review from a team as a code owner December 19, 2022 12:14

@akien-mga akien-mga left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we make gdextension_dir an optional override, I think we may as well refactor further and avoid having two options. Currently we would have:

  • One override for interface + JSON
  • One override of the override for JSON

Seems overkill.

The CMake would also need to be changed accordingly.

@Faless

Faless commented Dec 19, 2022 •

Copy link
Copy Markdown
Contributor Author

If we make gdextension_dir an optional override.

Well, it always was an optional override (otherwise it wouldn't be an option), it just didn't work with relative paths.

I think we may as well refactor further and avoid having two options

I'm fine with it but that would force a folder structure on those who only to override the extensions_api.json.

The CMake would also need to be changed accordingly.

I'm not sure what changes for CMake, it seems to have both GODOT_GDEXTENSION_DIR and GODOT_CUSTOM_API_FILE variables as well, so I assume it works, again, this PR just fixes existing options with relative paths.

@akien-mga

Copy link
Copy Markdown
Member

Well if we want not to force a folder structure, and since we have only two files to link, maybe we can make the two custom options point to one file each:

custom_interface_file
custom_api_file

@akien-mga akien-mga left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

My suggestions could be for a follow-up PR if we decide to change the options, for now this seems fine.

@Faless
Faless force-pushed the build/4.x_custom_paths branch from 36ecbfb to 6877a0a Compare January 9, 2023 20:10
@akien-mga
akien-mga merged commit 129c358 into godotengine:master Jan 9, 2023
@akien-mga

Copy link
Copy Markdown
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug This has been identified as a bug topic:buildsystem Related to the buildsystem or CI setup topic:gdextension This relates to the new Godot 4 extension implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants