Set up clangd for intellisense. Whoof, that was difficult.

This commit is contained in:
2025-06-09 15:38:14 -04:00
parent 61209d4c2f
commit 4a2574ddab
5 changed files with 58 additions and 15 deletions

View File

@@ -58,6 +58,7 @@ else:
CONFIG["INTEGRATION"] = os.path.dirname(os.path.abspath(sys.argv[0]))
CONFIG["UNREALENGINE"] = os.path.join(os.path.dirname(CONFIG["INTEGRATION"]), "UnrealEngine")
CONFIG["UE_BUILD_BAT"] = CONFIG["UNREALENGINE"] + "/Engine/Build/BatchFiles/" + CONFIG["BUILD_BAT"] + " -waitmutex"
globals().update(CONFIG)
@@ -72,9 +73,7 @@ if not os.path.isdir(f"{UNREALENGINE}/Engine/Source/Editor"):
#
# This is the code for a simple json preprocessor that can
# expand "for-each" loops and substitute variables. Because
# a single string is valid json, you can also use this to
# substitute variables in a string or a text file.
# expand "for-each" loops and substitute variables.
#
JSON_VAR_REGEX = re.compile(r'\[([A-Z0-9_]+)\]')
@@ -105,6 +104,11 @@ def expand_json_file(sourcefile, outputfile):
expanded = expand_json(data, CONFIG)
Path(outputfile).write_text(json.dumps(expanded, indent=4))
#
# Because a single string is valid json, we can also use the json
# expander to substitute variables in plain old text files.
#
def expand_text_file(sourcefile, outputfile):
Path(outputfile).unlink(missing_ok=True)
data = Path(sourcefile).read_text()
@@ -207,13 +211,14 @@ expand_json_file(f"{INTEGRATION}/Integration.code-workspace.tpl.json",
expand_text_file(f"{INTEGRATION}/Makefile.tpl.txt",
f"{INTEGRATION}/Makefile")
#
# Build ShaderCompileWorker
#
print("Building ShaderCompileWorker...")
shell(UNREALENGINE, f"{UNREALENGINE}/Engine/Build/BatchFiles/{BUILD_BAT} ShaderCompileWorker {OS} Shipping -waitmutex")
shell(UNREALENGINE, f"{UNREALENGINE}/Engine/Build/BatchFiles/{BUILD_BAT} -waitmutex ShaderCompileWorker {OS} Shipping")
Path(f"Engine/Binaries/{OS}/ShaderCompileWorker{DOT_EXE}").unlink(missing_ok=True)
shutil.copyfile(f"{UNREALENGINE}/Engine/Binaries/{OS}/ShaderCompileWorker-{OS}-Shipping{DOT_EXE}", f"{UNREALENGINE}/Engine/Binaries/{OS}/ShaderCompileWorker{DOT_EXE}")
@@ -221,5 +226,5 @@ shutil.copyfile(f"{UNREALENGINE}/Engine/Binaries/{OS}/ShaderCompileWorker-{OS}-S
# Run Make
#
shell(INTEGRATION, 'make')
shell(INTEGRATION, 'make intellisense')