Created
October 28, 2020 19:55
-
-
Save WiggleWizard/41f1ff753485e41b48ff1a7e32ad2e4b to your computer and use it in GitHub Desktop.
Helper files for building Godot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO off | |
python scons_helper.py vsproj=yes platform=windows target=release_debug tools=yes bits=64 custom_modules=../godot_modules4 -j4 | |
pause |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.