Skip to content

Commit 7344601

Browse files
authored
Merge pull request #58 from bruvzg/update_scripts
Update build scripts
2 parents fc5952a + 21067ca commit 7344601

File tree

7 files changed

+20
-64
lines changed

7 files changed

+20
-64
lines changed

SConstruct

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ env = DefaultEnvironment()
2020

2121
# Define our options
2222
opts.Add(EnumVariable('target', "Compilation target", 'debug', ['debug', 'release', "release_debug"]))
23-
opts.Add(EnumVariable('arch', "Compilation Architecture", '', ['', 'arm64', 'armv7', 'x86_64']))
23+
opts.Add(EnumVariable('arch', "Compilation Architecture", '', ['', 'arm64', 'x86_64']))
2424
opts.Add(BoolVariable('simulator', "Compilation platform", 'no'))
2525
opts.Add(BoolVariable('use_llvm', "Use the LLVM / Clang compiler", 'no'))
2626
opts.Add(PathVariable('target_path', 'The path where the lib is installed.', 'bin/'))
@@ -60,12 +60,12 @@ env.Append(CCFLAGS=["-fmodules", "-fcxx-modules"])
6060

6161
if env['simulator']:
6262
sdk_name = 'iphonesimulator'
63-
env.Append(CCFLAGS=['-mios-simulator-version-min=10.0'])
64-
env.Append(LINKFLAGS=["-mios-simulator-version-min=10.0"])
63+
env.Append(CCFLAGS=['-mios-simulator-version-min=12.0'])
64+
env.Append(LINKFLAGS=["-mios-simulator-version-min=12.0"])
6565
else:
6666
sdk_name = 'iphoneos'
67-
env.Append(CCFLAGS=['-miphoneos-version-min=10.0'])
68-
env.Append(LINKFLAGS=["-miphoneos-version-min=10.0"])
67+
env.Append(CCFLAGS=['-miphoneos-version-min=12.0'])
68+
env.Append(LINKFLAGS=["-miphoneos-version-min=12.0"])
6969

7070
try:
7171
sdk_path = decode_utf8(subprocess.check_output(['xcrun', '--sdk', sdk_name, '--show-sdk-path']).strip())
@@ -90,9 +90,6 @@ env.Prepend(CXXFLAGS=[
9090
])
9191
env.Append(LINKFLAGS=["-arch", env['arch'], '-isysroot', sdk_path, '-F' + sdk_path])
9292

93-
if env['arch'] == 'armv7':
94-
env.Prepend(CXXFLAGS=['-fno-aligned-allocation'])
95-
9693
if env['version'] == '3.x':
9794
env.Prepend(CFLAGS=['-std=gnu11'])
9895
env.Prepend(CXXFLAGS=['-DGLES_ENABLED', '-std=gnu++14'])
@@ -110,17 +107,15 @@ if env['version'] == '3.x':
110107
'-DPTRCALL_ENABLED',
111108
])
112109

113-
if env['arch'] != 'armv7':
114-
env.Prepend(CXXFLAGS=['-fomit-frame-pointer'])
110+
env.Prepend(CXXFLAGS=['-fomit-frame-pointer'])
115111
else:
116112
env.Prepend(CXXFLAGS=[
117113
'-O2', '-ftree-vectorize',
118114
'-DNDEBUG', '-DNS_BLOCK_ASSERTIONS=1',
119115
'-DPTRCALL_ENABLED',
120116
])
121117

122-
if env['arch'] != 'armv7':
123-
env.Prepend(CXXFLAGS=['-fomit-frame-pointer'])
118+
env.Prepend(CXXFLAGS=['-fomit-frame-pointer'])
124119
elif env['version'] == '4.0':
125120
env.Prepend(CFLAGS=['-std=gnu11'])
126121
env.Prepend(CXXFLAGS=['-DVULKAN_ENABLED', '-std=gnu++17'])
@@ -137,16 +132,14 @@ elif env['version'] == '4.0':
137132
'-DNDEBUG', '-DNS_BLOCK_ASSERTIONS=1', '-DDEBUG_ENABLED',
138133
])
139134

140-
if env['arch'] != 'armv7':
141-
env.Prepend(CXXFLAGS=['-fomit-frame-pointer'])
135+
env.Prepend(CXXFLAGS=['-fomit-frame-pointer'])
142136
else:
143137
env.Prepend(CXXFLAGS=[
144138
'-O2', '-ftree-vectorize',
145139
'-DNDEBUG', '-DNS_BLOCK_ASSERTIONS=1',
146140
])
147141

148-
if env['arch'] != 'armv7':
149-
env.Prepend(CXXFLAGS=['-fomit-frame-pointer'])
142+
env.Prepend(CXXFLAGS=['-fomit-frame-pointer'])
150143
else:
151144
print("No valid version to set flags for.")
152145
quit();

plugins/apn/apn.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
notificationsOptions |= UNAuthorizationOptionSound;
7979
}
8080

81-
[[GodotAPNAppDelegate shared] registerPushNotificationsWithOptions:options];
81+
[[GodotAPNAppDelegate shared] registerPushNotificationsWithOptions:notificationsOptions];
8282
}
8383

8484
void APNPlugin::update_device_token(String token) {

scripts/generate_headers.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ then
55
./../scripts/timeout scons platform=iphone target=release_debug
66
else
77
cd ./godot && \
8-
./../scripts/timeout scons platform=ios target=release_debug
8+
./../scripts/timeout scons platform=ios target=release_debug
99
fi

scripts/generate_static_library.sh

Lines changed: 0 additions & 18 deletions
This file was deleted.

scripts/generate_xcframework.sh

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,17 @@ set -e
55

66
# ARM64 Device
77
scons target=$2 arch=arm64 plugin=$1 version=$3
8-
# ARM7 Device
9-
scons target=$2 arch=armv7 plugin=$1 version=$3
108
# x86_64 Simulator
119
scons target=$2 arch=x86_64 simulator=yes plugin=$1 version=$3
1210
# ARM64 Simulator
1311
scons target=$2 arch=arm64 simulator=yes plugin=$1 version=$3
1412

1513
# Creating a fat libraries for device and simulator
1614
# lib<plugin>.<arch>-<simulator|ios>.<release|debug|release_debug>.a
17-
lipo -create "./bin/lib$1.x86_64-simulator.$2.a" "./bin/lib$1.arm64-simulator.$2.a" -output "./bin/$1-simulator.$2.a"
18-
lipo -create "./bin/lib$1.armv7-ios.$2.a" "./bin/lib$1.arm64-ios.$2.a" -output "./bin/$1-device.$2.a"
15+
lipo -create "./bin/lib$1.x86_64-simulator.$2.a" "./bin/lib$1.arm64-simulator.$2.a" -output "./bin/lib$1-simulator.$2.a"
1916

2017
# Creating a xcframework
2118
xcodebuild -create-xcframework \
22-
-library "./bin/$1-device.$2.a" \
23-
-library "./bin/$1-simulator.$2.a" \
19+
-library "./bin/lib$1.arm64-ios.$2.a" \
20+
-library "./bin/lib$1-simulator.$2.a" \
2421
-output "./bin/$1.$2.xcframework"

scripts/release_static_library.sh

Lines changed: 0 additions & 21 deletions
This file was deleted.

scripts/release_xcframework.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
#!/bin/bash
22
set -e
33

4-
GODOT_PLUGINS="gamecenter inappstore icloud camera arkit apn photo_picker"
4+
if [[ "$1" == "3.x" ]];
5+
then
6+
GODOT_PLUGINS="gamecenter inappstore icloud camera arkit apn photo_picker"
7+
else
8+
GODOT_PLUGINS="gamecenter inappstore icloud camera apn photo_picker"
9+
fi
510

611
# Compile Plugin
712
for lib in $GODOT_PLUGINS; do

0 commit comments

Comments
 (0)