Allow compiling out the navigation module #73031
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: #36091
Alternative to #69881
This is a stripped down version of #69881 which addresses the core problem of not being able to compile Godot without the navigation module, without the complexity of supporting GDExtension nor introducing a project setting for changing the server implementation.
It leaves the existing system for registering navigation servers alone and mainly updates
main.cpp
to check if no server has been registered and if so, swapping it out for a dummy implementation instead of throwing an error. Since there is always a dummy implementation compiled, the linker will always find an implementation ofNavigationServer3D
and won't fail to link if the module is missing.There are a few housekeeping items also in this PR, mostly swaps to equivalent types for readability, additional comments, missing
override
keywords, and a missingvirtual
keyword.All changes are backwards compatible, with no changes to ClassDB nor any changes to the C++ API shape. We'd like to include this change in 4.0 if possible.