Skip to content

Instantly share code, notes, and snippets.

@WiggleWizard
Created October 28, 2020 19: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 WiggleWizard/41f1ff753485e41b48ff1a7e32ad2e4b to your computer and use it in GitHub Desktop.
Save WiggleWizard/41f1ff753485e41b48ff1a7e32ad2e4b to your computer and use it in GitHub Desktop.
Helper files for building Godot
@ECHO off
python scons_helper.py vsproj=yes platform=windows target=release_debug tools=yes bits=64 custom_modules=../godot_modules4 -j4
pause
import sys
import os
# Figure out where Python is installed so we can reference the Scripts dir
python_dir = os.path.dirname(sys.executable)
# "source" the installed scons script
import imp
module = imp.load_source('', os.path.join(python_dir, "Scripts", "scons"))
# Dump current PID to file for Godot to pick up later
#with open("pid", 'w') as f:
# f.write(str(os.getpid()))
# Basically a copy from the scons python script
if __name__ == "__main__":
try:
import SCons.Script
except ImportError:
sys.stderr.write("SCons import failed. Unable to find engine files in:\n")
for path in libs:
sys.stderr.write(" {}\n".format(path))
raise
# this does all the work, and calls sys.exit
# with the proper exit status when done.
SCons.Script.main()
@WiggleWizard
Copy link
Author

Scons loves to create a new, mostly unchecked, command line which results in not being able to get its PID or if you run it from a batch script it will create a new terminal. These scripts were designed to help keep the scons runtime in check and under control.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment