Skip to content
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

Add compatibility-only suffix to env, denoting what environment the binary is compatible with. #1638

Closed
wants to merge 1 commit into from
Closed
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
40 changes: 27 additions & 13 deletions tools/godotcpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,30 @@ def make_doc_source(target, source, env):
g.close()


def make_suffix(env, compatibility_only=False) -> str:
suffix = ".{}".format(env["platform"])

if not compatibility_only:
suffix += "." + env["target"]

if env.dev_build and not compatibility_only:
suffix += ".dev"

if env["precision"] == "double":
suffix += ".double"

if not compatibility_only or env["arch"] != "universal":
suffix += "." + env["arch"]

if env["ios_simulator"] and not compatibility_only:
suffix += ".simulator"

if not env["threads"] and not compatibility_only:
suffix += ".nothreads"

return suffix


def generate(env):
# Default num_jobs to local cpu count if not user specified.
# SCons has a peculiarity where user-specified options won't be overridden
Expand Down Expand Up @@ -488,19 +512,9 @@ def generate(env):
env.Append(CPPDEFINES=["GDEXTENSION"])

# Suffix
suffix = ".{}.{}".format(env["platform"], env["target"])
if env.dev_build:
suffix += ".dev"
if env["precision"] == "double":
suffix += ".double"
suffix += "." + env["arch"]
if env["ios_simulator"]:
suffix += ".simulator"
if not env["threads"]:
suffix += ".nothreads"

env["suffix"] = suffix # Exposed when included from another project
env["OBJSUFFIX"] = suffix + env["OBJSUFFIX"]
env["suffix"] = make_suffix(env) # Exposed when included from another project
env["compatibility_suffix"] = make_suffix(env, compatibility_only=True)
env["OBJSUFFIX"] = env["suffix"] + env["OBJSUFFIX"]

# compile_commands.json
env.Tool("compilation_db")
Expand Down
Loading