Skip to content

Allow searching LIBRARY_PATH with build_library=no #1807

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions tools/godotcpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,16 +564,25 @@ def _godot_cpp(env):
library = None
library_name = "libgodot-cpp" + env["suffix"] + env["LIBSUFFIX"]

default_args = []

if env["build_library"]:
library = env.StaticLibrary(target=env.File("bin/%s" % library_name), source=sources)
env.NoCache(library)
default_args = [library]

# Add compiledb if the option is set
if env.get("compiledb", False):
default_args += ["compiledb"]
env.AppendUnique(LIBS=[env.File("bin/%s" % library_name)])
else:
# When not building the library, allow it to be found in other library
# paths on the system. It may have been built previously, so still add
# bin/ to the search path.
env.AppendUnique(LIBPATH=[env.Dir("bin/")])
env.AppendUnique(LIBS=[library_name])

# Add compiledb if the option is set
if env.get("compiledb", False):
default_args += ["compiledb"]

env.Default(*default_args)
env.Default(*default_args)

env.AppendUnique(LIBS=[env.File("bin/%s" % library_name)])
return library