2017-10-02 21:24:00 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
Import('env')
|
2017-12-12 15:18:55 +00:00
|
|
|
Import('env_modules')
|
|
|
|
|
|
|
|
env_mono = env_modules.Clone()
|
2017-10-02 21:24:00 +00:00
|
|
|
|
2017-12-12 15:18:55 +00:00
|
|
|
env_mono.add_source_files(env.modules_sources, '*.cpp')
|
2018-09-04 03:40:41 +00:00
|
|
|
env_mono.add_source_files(env.modules_sources, 'glue/*.cpp')
|
2017-12-12 15:18:55 +00: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 21:24:00 +00:00
|
|
|
|
|
|
|
if env['tools']:
|
2017-12-12 15:18:55 +00:00
|
|
|
env_mono.add_source_files(env.modules_sources, 'editor/*.cpp')
|
2018-09-04 20:13:47 +00:00
|
|
|
# NOTE: It is safe to generate this file here, since this is still executed serially
|
2019-03-01 20:51:20 +00: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 21:24:00 +00:00
|
|
|
|
|
|
|
vars = Variables()
|
|
|
|
vars.Add(BoolVariable('mono_glue', 'Build with the mono glue sources', True))
|
2017-10-24 20:47:27 +00:00
|
|
|
vars.Add(BoolVariable('xbuild_fallback', 'If MSBuild is not found, fallback to xbuild', False))
|
2018-02-11 03:48:46 +00:00
|
|
|
vars.Update(env_mono)
|
2017-10-02 21:24:00 +00:00
|
|
|
|
|
|
|
# Glue sources
|
2018-02-11 03:48:46 +00:00
|
|
|
if env_mono['mono_glue']:
|
2018-09-04 03:40:41 +00:00
|
|
|
env_mono.Append(CPPDEFINES=['MONO_GLUE_ENABLED'])
|
2017-10-02 21:24:00 +00:00
|
|
|
|
2019-03-01 20:51:20 +00:00
|
|
|
import os.path
|
|
|
|
if not os.path.isfile('glue/mono_glue.gen.cpp'):
|
|
|
|
raise RuntimeError('Missing mono glue sources. Did you forget to generate them?')
|
|
|
|
|
2019-01-22 17:33:36 +00:00
|
|
|
if env_mono['tools'] or env_mono['target'] != 'release':
|
|
|
|
env_mono.Append(CPPDEFINES=['GD_MONO_HOT_RELOAD'])
|
|
|
|
|
2019-03-01 20:51:20 +00:00
|
|
|
# Configure Thread Local Storage
|
|
|
|
|
|
|
|
import build_scripts.tls_configure as tls_configure
|
2018-06-26 19:03:42 +00:00
|
|
|
|
|
|
|
conf = Configure(env_mono)
|
|
|
|
tls_configure.configure(conf)
|
|
|
|
env_mono = conf.Finish()
|
|
|
|
|
2019-03-01 20:51:20 +00:00
|
|
|
# Configure Mono
|
2017-10-02 21:24:00 +00:00
|
|
|
|
2019-03-01 20:51:20 +00:00
|
|
|
import build_scripts.mono_configure as mono_configure
|
2017-10-24 20:47:27 +00:00
|
|
|
|
2019-03-01 21:00:39 +00:00
|
|
|
mono_configure.configure(env, env_mono)
|
2017-10-24 20:47:27 +00:00
|
|
|
|
2019-03-01 20:51:20 +00:00
|
|
|
# Build GodotSharpTools
|
2017-10-24 20:47:27 +00:00
|
|
|
|
2019-03-01 20:51:20 +00:00
|
|
|
import build_scripts.godotsharptools_build as godotsharptools_build
|
2017-10-24 20:47:27 +00:00
|
|
|
|
2019-03-01 20:51:20 +00:00
|
|
|
godotsharptools_build.build(env_mono)
|