Allow searching LIBRARY_PATH with build_library=no #1807
+14
−5
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.
Currently when building a downstream project with
build_library=no
, the library is still assumed to be present ingodot-cpp/bin/
from a previous build. With this change, allow the linker to search the system (LIBRARY_PATH
) for it. Whenbuild_library=yes
, the current behavior of passing the entire path to the linker is retained, since in that case you definitely intended to use the newly-built version.This change allows more flexibility in the build process of downstream projects: while they still need to have the godot-cpp submodule present for the
SConscript
, the library can more easily be built as part of a previous step or even preinstalled into the build environment. My specific goal is to save build time in CI with multiple GDExtensions that all use the same version of godot-cpp.I'm no scons expert so there may be a more idiomatic approach to this. It does technically have a side effect: if a shared library version of godot-cpp somehow existed on the system, it would be preferred because scons has no way to force a given library to be used statically. In practice, this will never happen.