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

Rename macOS and windows binaries to fit the OSs better in SConstruct #55

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ jobs:
APPLE_CERT_BASE64: ${{ secrets.APPLE_CERT_BASE64 }}
uses: ./.github/actions/sign
with:
FRAMEWORK_PATH: bin/macos/macos.framework
FRAMEWORK_PATH: bin/macos/EXTENSION-NAME.macos.template_release.universal.framework
APPLE_CERT_BASE64: ${{ secrets.APPLE_CERT_BASE64 }}
APPLE_CERT_PASSWORD: ${{ secrets.APPLE_CERT_PASSWORD }}
APPLE_DEV_PASSWORD: ${{ secrets.APPLE_DEV_PASSWORD }}
Expand Down
23 changes: 9 additions & 14 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
# Godot 4+ specific ignores
.godot/

# Ignore library files but not the gdextension file
demo/bin/*
!demo/bin/android
demo/bin/android/*
!demo/bin/android/.gitkeep
!demo/bin/linux
demo/bin/linux/*
!demo/bin/linux/.gitkeep
!demo/bin/macos
demo/bin/macos/*
!demo/bin/macos/.gitkeep
!demo/bin/windows
demo/bin/windows/*
!demo/bin/windows/.gitkeep
# Ignore built binaries
/demo/bin/**/*
!/demo/bin/**/
!/demo/bin/**/*.gitkeep
!/demo/bin/**/*.plist
/bin/**/*
!/bin/**/
!/bin/**/*.gitkeep
!/bin/**/*.plist
!demo/bin/*.gdextension
.sconsign*.dblite

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:
APPLE_CERT_BASE64: ${{ secrets.APPLE_CERT_BASE64 }}
uses: godotengine/godot-cpp-template/.github/actions/sign@main
with:
FRAMEWORK_PATH: bin/macos/macos.framework
FRAMEWORK_PATH: bin/macos/EXTENSION-NAME.macos.template_release.universal.framework
APPLE_CERT_BASE64: ${{ secrets.APPLE_CERT_BASE64 }}
APPLE_CERT_PASSWORD: ${{ secrets.APPLE_CERT_PASSWORD }}
APPLE_DEV_PASSWORD: ${{ secrets.APPLE_DEV_PASSWORD }}
Expand Down
23 changes: 16 additions & 7 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,29 @@ 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"])
filepath = ""
lib_filename = "{}{}{}{}".format(env.subst("$SHLIBPREFIX"), libname, env["suffix"], env.subst("$SHLIBSUFFIX"))
lib_filepath = ""

if env["platform"] == "macos" or env["platform"] == "ios":
filepath = "{}.framework/".format(env["platform"])
file = "{}.{}.{}".format(libname, env["platform"], env["target"])

libraryfile = "bin/{}/{}{}".format(env["platform"], filepath, file)
# By default, the above code generates .dylib files on macOS and iOS.
# The App Store rejects entries containing .dylib files, requiring a .framework structure instead.
# Details about the .framework structure are described Framework Programming Guide:
# https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/FrameworkAnatomy.html#//apple_ref/doc/uid/20002253-BAJEJJAB
framework_name = "{}{}".format(libname, env["suffix"])
lib_filename = framework_name
lib_filepath = "{}.framework/".format(framework_name)

# Prevents the binary from getting a prefix / suffix automatically
env["SHLIBPREFIX"] = ""
env["SHLIBSUFFIX"] = ""

libraryfile = "bin/{}/{}{}".format(env["platform"], lib_filepath, lib_filename)
library = env.SharedLibrary(
libraryfile,
source=sources,
)

copy = env.InstallAs("{}/bin/{}/{}lib{}".format(projectdir, env["platform"], filepath, file), library)
copy = env.Install("{}/bin/{}/{}".format(projectdir, env["platform"], lib_filepath), library)

default_args = [library, copy]
if localEnv.get("compiledb", False):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>libEXTENSION-NAME.macos.template_release</string>
<string>EXTENSION-NAME.ios.template_release.arm64</string>
<key>CFBundleName</key>
<string>Godot Template Cpp</string>
<key>CFBundleDisplayName</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>libEXTENSION-NAME.macos.template_release</string>
<string>EXTENSION-NAME.macos.template_release.universal</string>
<key>CFBundleName</key>
<string>Godot Cpp Template</string>
<key>CFBundleDisplayName</key>
Expand Down
12 changes: 6 additions & 6 deletions demo/bin/example.gdextension
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ compatibility_minimum = "4.1"

[libraries]

macos.debug = "res://bin/macos/macos.framework/libEXTENSION-NAME.macos.template_debug"
macos.release = "res://bin/macos/macos.framework/libEXTENSION-NAME.macos.template_release"
ios.debug = "res://bin/ios/ios.framework/libEXTENSION-NAME.ios.template_debug"
ios.release = "res://bin/ios/ios.framework/libEXTENSION-NAME.ios.template_release"
windows.debug.x86_32 = "res://bin/windows/libEXTENSION-NAME.windows.template_debug.x86_32.dll"
windows.release.x86_32 = "res://bin/windows/libEXTENSION-NAME.windows.template_release.x86_32.dll"
macos.debug = "res://bin/macos/EXTENSION-NAME.macos.template_debug.universal.framework"
macos.release = "res://bin/macos/EXTENSION-NAME.macos.template_release.universal.framework"
ios.debug = "res://bin/ios/EXTENSION-NAME.ios.template_debug.arm64.framework"
ios.release = "res://bin/ios/EXTENSION-NAME.ios.template_release.arm64.framework"
windows.debug.x86_32 = "res://bin/windows/EXTENSION-NAME.windows.template_debug.x86_32.dll"
windows.release.x86_32 = "res://bin/windows/EXTENSION-NAME.windows.template_release.x86_32.dll"
windows.debug.x86_64 = "res://bin/windows/libEXTENSION-NAME.windows.template_debug.x86_64.dll"
windows.release.x86_64 = "res://bin/windows/libEXTENSION-NAME.windows.template_release.x86_64.dll"
linux.debug.x86_64 = "res://bin/linux/libEXTENSION-NAME.linux.template_debug.x86_64.so"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>EXTENSION-NAME.macos.template_debug.universal</string>
<key>CFBundleIdentifier</key>
<string>org.godotengine.EXTENSION-NAME.macos.template_debug.universal</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>EXTENSION-NAME.macos.template_debug.universal</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>CFBundleVersion</key>
<string>1.0.0</string>
<key>LSMinimumSystemVersion</key>
<string>10.12</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>EXTENSION-NAME.macos.template_release.universal</string>
<key>CFBundleIdentifier</key>
<string>org.godotengine.EXTENSION-NAME.macos.template_release.universal</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>EXTENSION-NAME.macos.template_release.universal</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>CFBundleVersion</key>
<string>1.0.0</string>
<key>LSMinimumSystemVersion</key>
<string>10.12</string>
</dict>
</plist>