Rename windows libraries to drop the lib prefix, as this is not customary on Windows.

Drop `universal.` suffix on macOS, as this is implied if there is no distinction between arches.
Add more targets for the .gdextension file, including web, more linux targets, and separate single and double builds.
This commit is contained in:
Lukas Tenbrink
2025-04-10 00:03:06 +02:00
parent 96a28e560d
commit a009ff69f2
2 changed files with 56 additions and 22 deletions

View File

@@ -53,15 +53,18 @@ if env["target"] in ["editor", "template_debug"]:
except AttributeError:
print("Not including class reference as we're targeting a pre-4.3 baseline.")
file = "{}{}{}".format(libname, env["suffix"], env["SHLIBSUFFIX"])
# .dev doesn't inhibit compatibility, so we don't need to key it.
# .universal just means "compatible with all relevant arches" so we don't need to key it.
suffix = env['suffix'].replace(".dev", "").replace(".universal", "")
lib_filename = "{}{}{}{}".format(env.subst('$SHLIBPREFIX'), libname, suffix, env.subst('$SHLIBSUFFIX'))
libraryfile = "bin/{}/{}".format(env["platform"], file)
library = env.SharedLibrary(
libraryfile,
"bin/{}/{}".format(env['platform'], lib_filename),
source=sources,
)
copy = env.InstallAs("{}/bin/{}/lib{}".format(projectdir, env["platform"], file), library)
copy = env.Install("{}/bin/{}/".format(projectdir, env["platform"]), library)
default_args = [library, copy]
Default(*default_args)