Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions docs/cmake_kits.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,4 @@ You can also define general global kits in somewhere. To do this, you will have
1. Kits scan is not supported.
2. Option `visualStudio` and `visualStudioArchitecture` is not supported.
3. Option `preferredGenerator` is not supported.
4. Option `cmakeSettings` is not supported.
5. Option `environmentSetupScript` is only supported in the experimental terminal mode.
4. Option `environmentSetupScript` is only supported in the experimental terminal mode.
9 changes: 9 additions & 0 deletions lua/cmake-tools/kits.lua
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,15 @@ function kits.build_env_and_args(kit_name, escape, cwd, global_kits_path)
if kit.toolchainFile then
add_args({ "-DCMAKE_TOOLCHAIN_FILE:FILEPATH=" .. kit.toolchainFile })
end
if kit.cmakeSettings then
for k, v in pairs(kit.cmakeSettings) do
if type(v) == "boolean" then
add_args({ "-D" .. k .. ":BOOL=" .. string.upper(string.format("%s", v)) })
Comment thread
mattkrass marked this conversation as resolved.
Outdated
else
add_args({ "-D" .. k .. ":STRING=" .. string.format("%s", v) })
Comment thread
mattkrass marked this conversation as resolved.
Outdated
end
end
end

if kit.environmentVariables then
for k, v in pairs(kit.environmentVariables) do
Expand Down