From 9dea6b3f62cbf50913180215d4b4b6a0ac4ac178 Mon Sep 17 00:00:00 2001 From: Joel Linn Date: Tue, 3 Nov 2020 21:59:03 +0100 Subject: [PATCH] Add premake cmake generator. `./build/CMakeLists.txt` is generated by `./xb.bat premake --devenv=cmake` and enables use of other IDEs like `CLion` for example. --- .gitmodules | 3 +++ premake5.lua | 1 + third_party/premake-cmake | 1 + xenia-build | 4 ++-- 4 files changed, 7 insertions(+), 2 deletions(-) create mode 160000 third_party/premake-cmake diff --git a/.gitmodules b/.gitmodules index 6c3ca7278..c8b4ef272 100644 --- a/.gitmodules +++ b/.gitmodules @@ -64,3 +64,6 @@ [submodule "third_party/DirectXShaderCompiler"] path = third_party/DirectXShaderCompiler url = https://github.com/microsoft/DirectXShaderCompiler.git +[submodule "third_party/premake-cmake"] + path = third_party/premake-cmake + url = https://github.com/Enhex/premake-cmake.git diff --git a/premake5.lua b/premake5.lua index 7e9f590b2..2137515ba 100644 --- a/premake5.lua +++ b/premake5.lua @@ -1,5 +1,6 @@ include("tools/build") require("third_party/premake-export-compile-commands/export-compile-commands") +require("third_party/premake-cmake/cmake") location(build_root) targetdir(build_bin) diff --git a/third_party/premake-cmake b/third_party/premake-cmake new file mode 160000 index 000000000..26fbbb996 --- /dev/null +++ b/third_party/premake-cmake @@ -0,0 +1 @@ +Subproject commit 26fbbb9962aefcb1c24aff1e7952033ce1361190 diff --git a/xenia-build b/xenia-build index 081f36481..3b27e656f 100755 --- a/xenia-build +++ b/xenia-build @@ -372,9 +372,9 @@ def run_platform_premake(cc='clang', devenv=None): if 'VSVERSION' in os.environ: vs_version = os.environ['VSVERSION'] - return run_premake('windows', 'vs' + vs_version) + return run_premake('windows', devenv or ('vs' + vs_version)) else: - return run_premake('linux', devenv == 'codelite' and devenv or 'gmake2', cc) + return run_premake('linux', devenv or 'gmake2', cc) def run_premake_export_commands():