diff options
| author | star9029 <[email protected]> | 2024-11-14 18:33:37 +0800 |
|---|---|---|
| committer | star9029 <[email protected]> | 2024-11-14 18:33:37 +0800 |
| commit | ef7e37c8833d59455a7d30d7b7b244e3e230ea1d (patch) | |
| tree | 81814b4617c37c687cb616810dde899f86727e4c /xmake/plugins | |
| parent | 2c9034a9c7b6e567ba6f23089323d4908519d547 (diff) | |
Support custom vc build tools
Diffstat (limited to 'xmake/plugins')
| -rw-r--r-- | xmake/plugins/project/clang/compile_commands.lua | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/xmake/plugins/project/clang/compile_commands.lua b/xmake/plugins/project/clang/compile_commands.lua index fa32ea7ca..9996b4ed5 100644 --- a/xmake/plugins/project/clang/compile_commands.lua +++ b/xmake/plugins/project/clang/compile_commands.lua @@ -60,27 +60,28 @@ function _get_windows_sdk_arguments(target) local args = {} local msvc = target:toolchain("msvc") if msvc then + local includedirs = {} local envs = msvc:runenvs() local WindowsSdkDir = envs.WindowsSdkDir local WindowsSDKVersion = envs.WindowsSDKVersion - local VCToolsInstallDir = envs.VCToolsInstallDir if WindowsSdkDir and WindowsSDKVersion then - local includedirs = os.dirs(path.join(WindowsSdkDir, "Include", envs.WindowsSDKVersion, "*")) + table.join2(includedirs, os.dirs(path.join(WindowsSdkDir, "Include", envs.WindowsSDKVersion, "*"))) for _, tool in ipairs({"atlmfc", "diasdk"}) do local tool_dir = path.join(WindowsSdkDir, tool, "include") if os.isdir(tool_dir) then table.insert(includedirs, tool_dir) end end + end - if VCToolsInstallDir then - table.insert(includedirs, path.join(VCToolsInstallDir, "include")) - end + local VCToolsInstallDir = envs.VCToolsInstallDir + if VCToolsInstallDir then + table.insert(includedirs, path.join(VCToolsInstallDir, "include")) + end - for _, dir in ipairs(includedirs) do - table.insert(args, "-imsvc") - table.insert(args, dir) - end + for _, dir in ipairs(includedirs) do + table.insert(args, "-imsvc") + table.insert(args, dir) end end return args |
