2017-10-02 23:24:00 +02:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
2019-07-03 09:44:53 +02:00
|
|
|
import build_scripts.tls_configure as tls_configure
|
|
|
|
import build_scripts.mono_configure as mono_configure
|
|
|
|
|
2017-10-02 23:24:00 +02:00
|
|
|
Import('env')
|
2017-12-12 16:18:55 +01:00
|
|
|
Import('env_modules')
|
|
|
|
|
|
|
|
env_mono = env_modules.Clone()
|
2017-10-02 23:24:00 +02:00
|
|
|
|
2017-12-12 16:18:55 +01:00
|
|
|
env_mono.add_source_files(env.modules_sources, '*.cpp')
|
2018-09-04 05:40:41 +02:00
|
|
|
env_mono.add_source_files(env.modules_sources, 'glue/*.cpp')
|
2017-12-12 16:18:55 +01:00
|
|
|
env_mono.add_source_files(env.modules_sources, 'mono_gd/*.cpp')
|
|
|
|
env_mono.add_source_files(env.modules_sources, 'utils/*.cpp')
|
2017-10-02 23:24:00 +02:00
|
|
|
|
|
|
|
if env['tools']:
|
2017-12-12 16:18:55 +01:00
|
|
|
env_mono.add_source_files(env.modules_sources, 'editor/*.cpp')
|
2018-09-04 22:13:47 +02:00
|
|
|
# NOTE: It is safe to generate this file here, since this is still executed serially
|
2019-03-01 21:51:20 +01:00
|
|
|
import build_scripts.make_cs_compressed_header as make_cs_compressed_header
|
|
|
|
make_cs_compressed_header.generate_header(
|
|
|
|
'glue/Managed/Files',
|
|
|
|
'glue/cs_compressed.gen.h',
|
|
|
|
'glue/cs_glue_version.gen.h'
|
|
|
|
)
|
2017-10-02 23:24:00 +02:00
|
|
|
|
|
|
|
# Glue sources
|
2018-02-11 04:48:46 +01:00
|
|
|
if env_mono['mono_glue']:
|
2018-09-04 05:40:41 +02:00
|
|
|
env_mono.Append(CPPDEFINES=['MONO_GLUE_ENABLED'])
|
2017-10-02 23:24:00 +02:00
|
|
|
|
2019-03-01 21:51:20 +01:00
|
|
|
import os.path
|
|
|
|
if not os.path.isfile('glue/mono_glue.gen.cpp'):
|
2019-07-03 09:44:53 +02:00
|
|
|
raise RuntimeError("Mono glue sources not found. Did you forget to run '--generate-mono-glue'?")
|
2019-03-01 21:51:20 +01:00
|
|
|
|
2019-01-22 18:33:36 +01:00
|
|
|
if env_mono['tools'] or env_mono['target'] != 'release':
|
|
|
|
env_mono.Append(CPPDEFINES=['GD_MONO_HOT_RELOAD'])
|
|
|
|
|
2019-03-01 21:51:20 +01:00
|
|
|
# Configure Thread Local Storage
|
|
|
|
|
2018-06-26 21:03:42 +02:00
|
|
|
conf = Configure(env_mono)
|
|
|
|
tls_configure.configure(conf)
|
|
|
|
env_mono = conf.Finish()
|
|
|
|
|
2019-03-01 21:51:20 +01:00
|
|
|
# Configure Mono
|
2017-10-02 23:24:00 +02:00
|
|
|
|
2019-03-01 22:00:39 +01:00
|
|
|
mono_configure.configure(env, env_mono)
|
2017-10-24 22:47:27 +02:00
|
|
|
|
2019-07-03 09:44:53 +02:00
|
|
|
# Build Godot API solution
|
|
|
|
|
|
|
|
if env_mono['tools'] and env_mono['mono_glue']:
|
|
|
|
import build_scripts.api_solution_build as api_solution_build
|
|
|
|
api_solution_build.build(env_mono)
|
2017-10-24 22:47:27 +02:00
|
|
|
|
2019-07-03 09:44:53 +02:00
|
|
|
# Build GodotTools
|
2017-10-24 22:47:27 +02:00
|
|
|
|
2019-07-03 09:44:53 +02:00
|
|
|
if env_mono['tools']:
|
|
|
|
import build_scripts.godot_tools_build as godot_tools_build
|
|
|
|
if env_mono['mono_glue']:
|
|
|
|
godot_tools_build.build(env_mono)
|
|
|
|
else:
|
|
|
|
# Building without the glue sources so the Godot API solution may be missing.
|
|
|
|
# GodotTools depends on the Godot API solution. As such, we will only build
|
|
|
|
# GodotTools.ProjectEditor which doesn't depend on the Godot API solution and
|
|
|
|
# is required by the bindings generator in order to be able to generated it.
|
|
|
|
godot_tools_build.build_project_editor_only(env_mono)
|