2017-10-02 23:24:00 +02:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
2019-07-03 09:44:53 +02:00
|
|
|
import build_scripts.mono_configure as mono_configure
|
|
|
|
|
2020-03-30 08:28:32 +02:00
|
|
|
Import("env")
|
|
|
|
Import("env_modules")
|
2017-12-12 16:18:55 +01:00
|
|
|
|
|
|
|
env_mono = env_modules.Clone()
|
2017-10-02 23:24:00 +02:00
|
|
|
|
2020-03-30 08:28:32 +02:00
|
|
|
if env_mono["tools"]:
|
2018-09-04 22:13:47 +02:00
|
|
|
# NOTE: It is safe to generate this file here, since this is still executed serially
|
2019-12-28 19:12:32 +01:00
|
|
|
import build_scripts.gen_cs_glue_version as gen_cs_glue_version
|
2020-03-30 08:28:32 +02:00
|
|
|
|
|
|
|
gen_cs_glue_version.generate_header("glue/GodotSharp", "glue/cs_glue_version.gen.h")
|
2017-10-02 23:24:00 +02:00
|
|
|
|
|
|
|
# Glue sources
|
2020-03-30 08:28:32 +02:00
|
|
|
if env_mono["mono_glue"]:
|
|
|
|
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
|
2020-03-30 08:28:32 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
2020-03-30 08:28:32 +02:00
|
|
|
if env_mono["tools"] or env_mono["target"] != "release":
|
|
|
|
env_mono.Append(CPPDEFINES=["GD_MONO_HOT_RELOAD"])
|
2019-01-22 18:33:36 +01:00
|
|
|
|
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
|
|
|
|
2020-05-22 03:12:54 +02:00
|
|
|
if env_mono["tools"] and env_mono["mono_glue"] and env_mono["build_cil"]:
|
2019-12-28 19:12:32 +01:00
|
|
|
# Build Godot API solution
|
2019-07-03 09:44:53 +02:00
|
|
|
import build_scripts.api_solution_build as api_solution_build
|
2020-03-30 08:28:32 +02:00
|
|
|
|
2019-11-22 23:42:24 +01:00
|
|
|
api_sln_cmd = api_solution_build.build(env_mono)
|
2017-10-24 22:47:27 +02:00
|
|
|
|
2019-12-28 19:12:32 +01:00
|
|
|
# Build GodotTools
|
2019-07-03 09:44:53 +02:00
|
|
|
import build_scripts.godot_tools_build as godot_tools_build
|
2020-03-30 08:28:32 +02:00
|
|
|
|
2019-12-28 19:12:32 +01:00
|
|
|
godot_tools_build.build(env_mono, api_sln_cmd)
|
2019-08-26 17:46:57 +02:00
|
|
|
|
2020-10-23 09:25:16 +02:00
|
|
|
# Build Godot.NET.Sdk
|
|
|
|
import build_scripts.godot_net_sdk_build as godot_net_sdk_build
|
|
|
|
|
|
|
|
godot_net_sdk_build.build(env_mono)
|
|
|
|
|
2019-08-26 17:46:57 +02:00
|
|
|
# Add sources
|
|
|
|
|
2020-03-30 08:28:32 +02:00
|
|
|
env_mono.add_source_files(env.modules_sources, "*.cpp")
|
|
|
|
env_mono.add_source_files(env.modules_sources, "glue/*.cpp")
|
2021-10-16 15:53:08 +02:00
|
|
|
env_mono.add_source_files(env.modules_sources, "glue/mono_glue.gen.cpp")
|
2020-03-30 08:28:32 +02:00
|
|
|
env_mono.add_source_files(env.modules_sources, "mono_gd/*.cpp")
|
|
|
|
env_mono.add_source_files(env.modules_sources, "utils/*.cpp")
|
2019-08-26 17:46:57 +02:00
|
|
|
|
2020-03-18 17:40:04 +01:00
|
|
|
env_mono.add_source_files(env.modules_sources, "mono_gd/support/*.cpp")
|
|
|
|
|
|
|
|
if env["platform"] in ["osx", "iphone"]:
|
|
|
|
env_mono.add_source_files(env.modules_sources, "mono_gd/support/*.mm")
|
|
|
|
env_mono.add_source_files(env.modules_sources, "mono_gd/support/*.m")
|
2021-10-16 15:53:08 +02:00
|
|
|
elif env["platform"] == "android":
|
|
|
|
env_mono.add_source_files(env.modules_sources, "mono_gd/android_mono_config.gen.cpp")
|
2020-03-18 17:40:04 +01:00
|
|
|
|
2020-03-30 08:28:32 +02:00
|
|
|
if env["tools"]:
|
|
|
|
env_mono.add_source_files(env.modules_sources, "editor/*.cpp")
|