diff --git a/.gitmodules b/.gitmodules index 44d4ef64f..d633d675b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -28,3 +28,6 @@ [submodule "third_party/snappy"] path = third_party/snappy url = https://github.com/xenia-project/snappy.git +[submodule "third_party/premake-export-compile-commands"] + path = third_party/premake-export-compile-commands + url = https://github.com/xenia-project/premake-export-compile-commands.git diff --git a/premake5.lua b/premake5.lua index 94d99284a..a258f84eb 100644 --- a/premake5.lua +++ b/premake5.lua @@ -1,4 +1,5 @@ include("tools/build") +require("third_party/premake-export-compile-commands/export-compile-commands") location(build_root) targetdir(build_bin) diff --git a/third_party/premake-core b/third_party/premake-core index 1b2f19fa8..8f0683d82 160000 --- a/third_party/premake-core +++ b/third_party/premake-core @@ -1 +1 @@ -Subproject commit 1b2f19fa879d99ebe6dd57789525dc47dacd1c77 +Subproject commit 8f0683d823963d097cf4bc2958b5f50f35f6456a diff --git a/third_party/premake-export-compile-commands b/third_party/premake-export-compile-commands new file mode 160000 index 000000000..846aedb0c --- /dev/null +++ b/third_party/premake-export-compile-commands @@ -0,0 +1 @@ +Subproject commit 846aedb0c4c6fe38b50be7a8be06990232892812 diff --git a/tools/build/bin/premake5.exe b/tools/build/bin/premake5.exe index 87510e936..e89ef4e38 100644 Binary files a/tools/build/bin/premake5.exe and b/tools/build/bin/premake5.exe differ diff --git a/xenia-build b/xenia-build index 80dfc2c58..ef2652113 100755 --- a/xenia-build +++ b/xenia-build @@ -329,6 +329,18 @@ def run_platform_premake(): run_premake('linux', 'codelite') +def run_premake_export_commands(): + """Runs premake to generate an LLVM compile_commands.json file. + """ + # TODO(benvanik): only do linux? whatever clang-tidy is ok with. + if sys.platform == 'darwin': + run_premake('macosx', 'export-compile-commands') + elif sys.platform == 'win32': + run_premake('windows', 'export-compile-commands') + else: + run_premake('linux', 'export-compile-commands') + + def get_build_bin_path(args): """Returns the path of the bin/ path with build results based on the configuration specified in the parsed arguments.