Skip to content

Commit a3a4f90

Browse files
committed
Restructure and cleanup
Moved plugins and scripts to different folders. Direct usage of Godot's source instead of exported headers. XCFramework and Static Library scripts to build final plugin library.
1 parent 401113c commit a3a4f90

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+129
-132
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "godot"]
2+
path = godot
3+
url = https://github.com/godotengine/godot

LICENCE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 Godot Engine
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 23 additions & 0 deletions

SConstruct

Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ opts.Add(PathVariable('target_path', 'The path where the lib is installed.', 'bi
2727
opts.Add(EnumVariable('plugin', 'Plugin to build', '', ['', 'arkit', 'camera', 'icloud', 'gamecenter', 'inappstore']))
2828
opts.Add(EnumVariable('version', 'Godot version to target', '', ['', '3.2', '4.0']))
2929

30-
# Local dependency paths, adapt them to your setup
31-
godot_path = "godot/"
32-
godot_library = "ios.fat.a"
33-
3430
# Updates the environment with the option variables.
3531
opts.Update(env)
3632

@@ -94,6 +90,9 @@ env.Prepend(CXXFLAGS=[
9490
])
9591
env.Append(LINKFLAGS=["-arch", env['arch'], '-isysroot', sdk_path, '-F' + sdk_path])
9692

93+
if env['arch'] == 'armv7':
94+
env.Prepend(CXXFLAGS=['-fno-aligned-allocation'])
95+
9796
if env['version'] == '3.2':
9897
env.Prepend(CFLAGS=['-std=gnu11'])
9998
env.Prepend(CXXFLAGS=['-DGLES_ENABLED', '-std=gnu++14'])
@@ -106,16 +105,22 @@ if env['version'] == '3.2':
106105
'-DPTRCALL_ENABLED',
107106
])
108107
elif env['target'] == 'release_debug':
109-
env.Prepend(CXXFLAGS=['-O2', '-ftree-vectorize', '-fomit-frame-pointer',
108+
env.Prepend(CXXFLAGS=['-O2', '-ftree-vectorize',
110109
'-DNDEBUG', '-DNS_BLOCK_ASSERTIONS=1', '-DDEBUG_ENABLED',
111110
'-DPTRCALL_ENABLED',
112111
])
112+
113+
if env['arch'] != 'armv7':
114+
env.Prepend(CXXFLAGS=['-fomit-frame-pointer'])
113115
else:
114116
env.Prepend(CXXFLAGS=[
115-
'-O2', '-ftree-vectorize', '-fomit-frame-pointer',
117+
'-O2', '-ftree-vectorize',
116118
'-DNDEBUG', '-DNS_BLOCK_ASSERTIONS=1',
117119
'-DPTRCALL_ENABLED',
118120
])
121+
122+
if env['arch'] != 'armv7':
123+
env.Prepend(CXXFLAGS=['-fomit-frame-pointer'])
119124
elif env['version'] == '4.0':
120125
env.Prepend(CFLAGS=['-std=gnu11'])
121126
env.Prepend(CXXFLAGS=['-DVULKAN_ENABLED', '-std=gnu++17'])
@@ -128,38 +133,44 @@ elif env['version'] == '4.0':
128133
])
129134
elif env['target'] == 'release_debug':
130135
env.Prepend(CXXFLAGS=[
131-
'-O2', '-ftree-vectorize', '-fomit-frame-pointer',
136+
'-O2', '-ftree-vectorize',
132137
'-DNDEBUG', '-DNS_BLOCK_ASSERTIONS=1', '-DDEBUG_ENABLED',
133138
])
139+
140+
if env['arch'] != 'armv7':
141+
env.Prepend(CXXFLAGS=['-fomit-frame-pointer'])
134142
else:
135143
env.Prepend(CXXFLAGS=[
136-
'-O2', '-ftree-vectorize', '-fomit-frame-pointer',
144+
'-O2', '-ftree-vectorize',
137145
'-DNDEBUG', '-DNS_BLOCK_ASSERTIONS=1',
138146
])
147+
148+
if env['arch'] != 'armv7':
149+
env.Prepend(CXXFLAGS=['-fomit-frame-pointer'])
139150
else:
140151
print("No valid version to set flags for.")
141152
quit();
142153

143154
# Adding header files
144155
env.Append(CPPPATH=[
145156
'.',
146-
'godot_headers',
147-
'godot_headers/main',
148-
'godot_headers/core',
149-
'godot_headers/core/os',
150-
'godot_headers/core/platform',
151-
'godot_headers/platform/iphone',
152-
'godot_headers/modules',
153-
'godot_headers/scene',
154-
'godot_headers/servers',
155-
'godot_headers/drivers',
156-
'godot_headers/thirdparty',
157+
'godot',
158+
'godot/main',
159+
'godot/core',
160+
'godot/core/os',
161+
'godot/core/platform',
162+
'godot/platform/iphone',
163+
'godot/modules',
164+
'godot/scene',
165+
'godot/servers',
166+
'godot/drivers',
167+
'godot/thirdparty',
157168
])
158169

159170
# tweak this if you want to use different folders, or more folders, to store your source code in.
160-
sources = Glob(env['plugin'] + '/*.cpp')
161-
sources.append(Glob(env['plugin'] + '/*.mm'))
162-
sources.append(Glob(env['plugin'] + '/*.m'))
171+
sources = Glob('plugins/' + env['plugin'] + '/*.cpp')
172+
sources.append(Glob('plugins/' + env['plugin'] + '/*.mm'))
173+
sources.append(Glob('plugins/' + env['plugin'] + '/*.m'))
163174

164175
# lib<plugin>.<arch>-<simulator|iphone>.<release|debug|release_debug>.a
165176
library_platform = env["arch"] + "-" + ("simulator" if env["simulator"] else "iphone")

arkit/SCsub

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

arkit/config.py

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

camera/SCsub

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

camera/config.py

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

gamecenter/SCsub

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

gamecenter/config.py

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

0 commit comments

Comments
 (0)