2017-04-03 14:11:38 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
Import('env')
|
|
|
|
|
2017-09-03 10:40:41 +00:00
|
|
|
gdn_env = env.Clone()
|
2017-10-03 03:23:05 +00:00
|
|
|
gdn_env.add_source_files(env.modules_sources, "gdnative.cpp")
|
|
|
|
gdn_env.add_source_files(env.modules_sources, "register_types.cpp")
|
2018-06-16 00:29:11 +00:00
|
|
|
gdn_env.add_source_files(env.modules_sources, "android/*.cpp")
|
2017-09-03 10:40:41 +00:00
|
|
|
gdn_env.add_source_files(env.modules_sources, "gdnative/*.cpp")
|
|
|
|
gdn_env.add_source_files(env.modules_sources, "nativescript/*.cpp")
|
2017-12-15 14:35:16 +00:00
|
|
|
gdn_env.add_source_files(env.modules_sources, "gdnative_library_singleton_editor.cpp")
|
|
|
|
gdn_env.add_source_files(env.modules_sources, "gdnative_library_editor_plugin.cpp")
|
2017-09-03 10:40:41 +00:00
|
|
|
|
|
|
|
gdn_env.Append(CPPPATH=['#modules/gdnative/include/'])
|
2017-04-03 14:11:38 +00:00
|
|
|
|
2018-06-26 18:26:51 +00:00
|
|
|
SConscript("net/SCsub")
|
2017-11-10 11:36:50 +00:00
|
|
|
SConscript("arvr/SCsub")
|
2017-10-08 21:47:38 +00:00
|
|
|
SConscript("pluginscript/SCsub")
|
2017-10-07 13:51:17 +00:00
|
|
|
|
2018-03-17 22:23:55 +00:00
|
|
|
from platform_methods import run_in_subprocess
|
|
|
|
import gdnative_builders
|
2017-10-03 03:23:05 +00:00
|
|
|
|
|
|
|
|
2018-06-21 04:33:25 +00:00
|
|
|
_, gensource = gdn_env.CommandNoCache(['include/gdnative_api_struct.gen.h', 'gdnative_api_struct.gen.cpp'],
|
2018-03-17 22:23:55 +00:00
|
|
|
'gdnative_api.json', run_in_subprocess(gdnative_builders.build_gdnative_api_struct))
|
2017-10-03 03:23:05 +00:00
|
|
|
gdn_env.add_source_files(env.modules_sources, [gensource])
|
|
|
|
|
2017-08-02 12:21:12 +00:00
|
|
|
env.use_ptrcall = True
|
2017-10-03 21:07:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
if ARGUMENTS.get('gdnative_wrapper', False):
|
2018-03-17 22:23:55 +00:00
|
|
|
gensource, = gdn_env.CommandNoCache('gdnative_wrapper_code.gen.cpp', 'gdnative_api.json', run_in_subprocess(gdnative_builders.build_gdnative_wrapper_code))
|
2017-10-03 21:07:29 +00:00
|
|
|
|
|
|
|
gd_wrapper_env = env.Clone()
|
|
|
|
gd_wrapper_env.Append(CPPPATH=['#modules/gdnative/include/'])
|
|
|
|
|
2018-01-04 18:42:02 +00:00
|
|
|
if gd_wrapper_env['use_lto']:
|
|
|
|
if not env.msvc:
|
2018-04-30 10:59:08 +00:00
|
|
|
gd_wrapper_env.Append(CCFLAGS=['-fno-lto'])
|
|
|
|
gd_wrapper_env.Append(LINKFLAGS=['-fno-lto'])
|
2018-01-04 18:42:02 +00:00
|
|
|
else:
|
|
|
|
gd_wrapper_env.Append(CCFLAGS=['/GL-'])
|
|
|
|
gd_wrapper_env.Append(LINKFLAGS=['/LTCG:OFF'])
|
|
|
|
|
2017-11-25 19:26:42 +00:00
|
|
|
if not env.msvc:
|
|
|
|
gd_wrapper_env.Append(CCFLAGS=['-fPIC'])
|
2017-10-03 21:07:29 +00:00
|
|
|
|
2017-11-28 20:27:57 +00:00
|
|
|
lib = gd_wrapper_env.add_library("#bin/gdnative_wrapper_code", [gensource])
|