diff options
| author | ruki <[email protected]> | 2024-11-20 10:35:27 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-11-20 10:35:27 +0800 |
| commit | 6f2dc65a267c11c9dbe016e536fd8c756042884a (patch) | |
| tree | c780783f6f485e736f39ed078fce08c4e1c52457 /xmake/plugins | |
| parent | 959106bc784e0a8c218c331970afc25bed52e9c6 (diff) | |
| parent | 22e37a1f4e93e58c08d2cffa5e79a6dc1e6588b0 (diff) | |
Merge pull request #5823 from star-hengxing/msvc-build-tools
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 |
