summaryrefslogtreecommitdiff
path: root/modules/mono
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2019-11-23 11:24:48 +0100
committerGitHub <noreply@github.com>2019-11-23 11:24:48 +0100
commit636bc5c32f07050fb387a7f8f5f78f7dc9aef7be (patch)
treec2690484ad076171897f497786caf2148166ed62 /modules/mono
parent9b2073aa97770ae7f53cfa57d241c55bb2feb3d3 (diff)
parentebdd2bc474f6bb3ff124755196fa116c4fd91385 (diff)
Merge pull request #33828 from neikeq/貴様
Mono/C#: Prevent SCons from building API solutions in parallel
Diffstat (limited to 'modules/mono')
-rw-r--r--modules/mono/SCsub4
-rw-r--r--modules/mono/build_scripts/api_solution_build.py12
-rw-r--r--modules/mono/build_scripts/godot_tools_build.py8
3 files changed, 15 insertions, 9 deletions
diff --git a/modules/mono/SCsub b/modules/mono/SCsub
index a9afa7ccf6..457edfaeed 100644
--- a/modules/mono/SCsub
+++ b/modules/mono/SCsub
@@ -42,14 +42,14 @@ mono_configure.configure(env, env_mono)
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)
+ api_sln_cmd = api_solution_build.build(env_mono)
# Build GodotTools
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)
+ godot_tools_build.build(env_mono, api_sln_cmd)
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
diff --git a/modules/mono/build_scripts/api_solution_build.py b/modules/mono/build_scripts/api_solution_build.py
index 1fe00a3028..be54d0a679 100644
--- a/modules/mono/build_scripts/api_solution_build.py
+++ b/modules/mono/build_scripts/api_solution_build.py
@@ -55,12 +55,22 @@ def build(env_mono):
'GodotSharpEditor.dll', 'GodotSharpEditor.pdb', 'GodotSharpEditor.xml'
]
+ depend_cmd = []
+
for build_config in ['Debug', 'Release']:
output_dir = Dir('#bin').abspath
editor_api_dir = os.path.join(output_dir, 'GodotSharp', 'Api', build_config)
targets = [os.path.join(editor_api_dir, filename) for filename in target_filenames]
- cmd = env_mono.CommandNoCache(targets, [], build_api_solution,
+ cmd = env_mono.CommandNoCache(targets, depend_cmd, build_api_solution,
module_dir=os.getcwd(), solution_build_config=build_config)
env_mono.AlwaysBuild(cmd)
+
+ # Make the Release build of the API solution depend on the Debug build.
+ # We do this in order to prevent SCons from building them in parallel,
+ # which can freak out MSBuild. In many cases, one of the builds would
+ # hang indefinitely requiring a key to be pressed for it to continue.
+ depend_cmd = cmd
+
+ return depend_cmd
diff --git a/modules/mono/build_scripts/godot_tools_build.py b/modules/mono/build_scripts/godot_tools_build.py
index 35daa6d307..03aaa925f0 100644
--- a/modules/mono/build_scripts/godot_tools_build.py
+++ b/modules/mono/build_scripts/godot_tools_build.py
@@ -74,15 +74,11 @@ def build_godot_tools_project_editor(source, target, env):
copy_target(str(scons_target))
-def build(env_mono):
+def build(env_mono, api_sln_cmd):
assert env_mono['tools']
output_dir = Dir('#bin').abspath
editor_tools_dir = os.path.join(output_dir, 'GodotSharp', 'Tools')
- editor_api_dir = os.path.join(output_dir, 'GodotSharp', 'Api', 'Debug')
-
- source_filenames = ['GodotSharp.dll', 'GodotSharpEditor.dll']
- sources = [os.path.join(editor_api_dir, filename) for filename in source_filenames]
target_filenames = [
'GodotTools.dll', 'GodotTools.IdeConnection.dll', 'GodotTools.BuildLogger.dll',
@@ -97,7 +93,7 @@ def build(env_mono):
targets = [os.path.join(editor_tools_dir, filename) for filename in target_filenames]
- cmd = env_mono.CommandNoCache(targets, sources, build_godot_tools, module_dir=os.getcwd())
+ cmd = env_mono.CommandNoCache(targets, api_sln_cmd, build_godot_tools, module_dir=os.getcwd())
env_mono.AlwaysBuild(cmd)