From 54400cbc2cf3273c9f9c307497215cb89a8521d0 Mon Sep 17 00:00:00 2001
From: Gliniak <153369+Gliniak@users.noreply.github.com>
Date: Sun, 8 Mar 2026 19:38:28 +0100
Subject: [PATCH] [Build] Integration with CLion
---
xenia-build.py | 130 ++++++++++++++++++++++++++++++++++++++++++++-----
1 file changed, 119 insertions(+), 11 deletions(-)
diff --git a/xenia-build.py b/xenia-build.py
index f9b230ef6..5baf3f86a 100755
--- a/xenia-build.py
+++ b/xenia-build.py
@@ -24,6 +24,53 @@ __author__ = "ben.vanik@gmail.com (Ben Vanik)"
self_path = os.path.dirname(os.path.abspath(__file__))
+# TODO: Automate getting these entries
+XENIA_TARGETS = [
+ "aes_128",
+ "capstone",
+ "dxbc",
+ "discord-rpc",
+ "fmt",
+ "glslang-spirv",
+ "imgui",
+ "libavcodec",
+ "libavformat",
+ "libavutil",
+ "mspack",
+ "pugixml",
+ "snappy",
+ "xxhash",
+ "zarchive",
+ "zlib-ng",
+ "zstd",
+ "xenia-app",
+ "xenia-app-discord",
+ "xenia-apu",
+ "xenia-apu-alsa",
+ "xenia-apu-nop",
+ "xenia-apu-sdl",
+ "xenia-base",
+ "xenia-core",
+ "xenia-cpu",
+ "xenia-cpu-backend-x64",
+ "xenia-debug-ui",
+ "xenia-gpu",
+ "xenia-gpu-null",
+ "xenia-gpu-vulkan",
+ "xenia-gpu-vulkan-spirv-shaders",
+ "xenia-helper-sdl",
+ "xenia-hid",
+ "xenia-hid-nop",
+ "xenia-hid-sdl",
+ "xenia-hid-skylander",
+ "xenia-kernel",
+ "xenia-patcher",
+ "xenia-ui",
+ "xenia-ui-vulkan",
+ "xenia-ui-vulkan-spirv-shaders",
+ "xenia-vfs",
+]
+
class bcolors:
# HEADER = "\033[95m"
# OKBLUE = "\033[94m"
@@ -690,26 +737,86 @@ def create_clion_workspace():
with open(os.path.join(".idea", "misc.xml"), "w") as f:
f.write("""
-
-
+
+
+
""")
- # Set available configurations
- # TODO Find a way to trigger a cmake reload
+ # Create workspace.xml file
with open(os.path.join(".idea", "workspace.xml"), "w") as f:
+ # Write CmakePresetLoader
f.write("""
-
-
-
-
-
-
+
+""")
+ f.write("""
+
-""")
+""")
+ # Write ConfigurationManager
+ f.write(""" \n""")
+ f.write(" \n")
+ # Loop over every entry
+ for target in XENIA_TARGETS:
+ f.write(f' \n')
+ f.write(" \n")
+ f.write(" \n")
+
+ # Write CMakeSettings
+ f.write(""" \n""")
+ f.write(" \n")
+ f.write(""" \n""")
+ f.write(""" \n""")
+ f.write(""" \n""")
+ f.write(" \n")
+ f.write(" \n")
+
+ # Write RunManager
+ # Write basic xenia-app manually
+ f.write(""" \n""")
+ f.write(""" \n""")
+ f.write(""" \n""")
+ f.write(""" \n""")
+ f.write(""" \n""")
+ f.write(""" \n""")
+
+ for target in XENIA_TARGETS:
+ if target != "xenia-app":
+ f.write(f' \n')
+ else:
+ f.write(f' \n')
+
+ f.write(""" \n""")
+ f.write(""" \n""")
+ f.write(""" \n""")
+ f.write(""" \n""")
+
+ # Write itemvalue list
+ f.write(""" \n""")
+ for target in XENIA_TARGETS:
+ f.write(f' \n')
+
+ f.write("""
\n""")
+ f.write(""" \n""")
+ f.write("""\n""")
+
+ os.makedirs(os.path.join(".idea", "codeStyles"), exist_ok=True)
+ with open(os.path.join(".idea", "codeStyles", "Project.xml"), "w") as f:
+ f.write("""
+
+
+
+
+
+
+
+
+""")
return True
@@ -1789,6 +1896,7 @@ class DevenvCommand(Command):
print("Launching Visual Studio...")
elif has_bin("clion") or has_bin("clion.sh"):
print("Launching CLion...")
+ create_clion_workspace()
else:
print("IDE not detected. CMakeLists.txt is in the project root.")