Skip to content

Commit

Permalink
[Demo Project] Add macOS framework templates, update Scons build scri…
Browse files Browse the repository at this point in the history
…pt and ".gdextension" file.
  • Loading branch information
bruvzg committed Jan 11, 2022
1 parent 02d9838 commit a263344
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ if env["target"] == "debug":

# Check our platform specifics
if env["platform"] == "osx":
env["target_path"] += "osx/"
env["target_path"] += "{}.{}.framework/".format(env["target_name"], env["target"])
cpp_library += ".osx"

if env["bits"] == "32":
Expand Down Expand Up @@ -154,7 +154,11 @@ env.Append(LIBS=[cpp_library])
env.Append(CPPPATH=["src/"])
sources = Glob("src/*.cpp")

target_name = "{}.{}.{}.{}".format(env["target_name"], env["platform"], env["target"], arch_suffix)
if env["platform"] == "osx":
target_name = "{}.{}".format(env["target_name"], env["target"])
else:
target_name = "{}.{}.{}.{}".format(env["target_name"], env["platform"], env["target"], arch_suffix)

print(target_name)
library = env.SharedLibrary(target=env["target_path"] + target_name, source=sources)

Expand Down
26 changes: 26 additions & 0 deletions test/demo/bin/libgdexample.debug.framework/Resources/Info.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>libgdexample.debug</string>
<key>CFBundleIdentifier</key>
<string>org.godotengine.libgdexample</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>libgdexample.debug</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>
26 changes: 26 additions & 0 deletions test/demo/bin/libgdexample.release.framework/Resources/Info.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>libgdexample.release</string>
<key>CFBundleIdentifier</key>
<string>org.godotengine.libgdexample</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>libgdexample.release</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>
2 changes: 2 additions & 0 deletions test/demo/example.gdextension
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ linux.64.debug = "bin/libgdexample.linux.debug.64.so"
linux.64.release = "bin/libgdexample.linux.release.64.so"
windows.64.debug = "bin/libgdexample.windows.debug.64.dll"
windows.64.release = "bin/libgdexample.windows.release.64.dll"
macos.debug = "bin/libgdexample.debug.framework"
macos.release = "bin/libgdexample.release.framework"
2 changes: 2 additions & 0 deletions test/demo/main.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ text = "Click me!"
__meta__ = {
"_edit_use_anchors_": false
}

[connection signal="custom_signal" from="Example" to="." method="_on_Example_custom_signal"]

0 comments on commit a263344

Please sign in to comment.