Skip to content

Instantly share code, notes, and snippets.

@Ertain
Last active May 31, 2018 17:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ertain/3b22ebc12f6f9032255241d768030f1a to your computer and use it in GitHub Desktop.
Save Ertain/3b22ebc12f6f9032255241d768030f1a to your computer and use it in GitHub Desktop.
Builds the Godot Engine with Mono bindings on Linux
#!/bin/bash
if [ ! $(which scons) ]; then
echo "Please install scons."
exit 2
fi
if [ ! $(which msbuild) ]; then
echo "Please install msbuild."
exit 3
fi
function clean_sources {
echo "Now cleaning sources and deleting compiled files..."
scons --clean p=x11 tools=yes module_mono_enabled=yes mono_glue=no > /dev/null 2>&1
scons --clean p=x11 target=release_debug tools=yes module_mono_enabled=yes > /dev/null 2>&1
scons --clean p=x11 target=debug tools=no module_mono_enabled=yes > /dev/null 2>&1
echo "All built files deleted."
exit 0
}
if [ "$1" == "clean" ]; then
clean_sources
fi
echo "Now building the basics..."
scons p=x11 tools=yes module_mono_enabled=yes mono_glue=no > build_error-basics.log 2>&1
echo "Basics built."
if [ -f bin/godot.x11.tools.64.mono ]; then
echo "Now generating Mono glue..."
bin/godot.x11.tools.64.mono --no-window --generate-mono-glue modules/mono/glue 2>> build_error-mono_glue.log > /dev/null 2>&1
echo "Mono glue generated."
else
echo "File not found: bin/godot.x11.tools.64.mono"
exit 1
fi
# Build the binaries normally
echo "Now building binaries..."
scons p=x11 target=release_debug tools=yes module_mono_enabled=yes > build_error-editor.log 2>&1
echo "Editor binary built."
echo "Now building export templates..."
echo "Debug template..."
scons p=x11 target=release_debug tools=no module_mono_enabled=yes > build_debug_templates-error.log 2>&1
echo "Debug template built."
echo "Release template..."
scons p=x11 target=release tools=no module_mono_enabled=yes > build_release_template-error.log 2>&1
echo "Release template built."
echo "All targets built."
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment