Skip to content

Commit 23a90bd

Browse files
mattkrasslceWolf
authored andcommitted
Support cmakeSettings field in kits files
1 parent 75a3589 commit 23a90bd

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

docs/cmake_kits.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,4 @@ You can also define general global kits in somewhere. To do this, you will have
5151
1. Kits scan is not supported.
5252
2. Option `visualStudio` and `visualStudioArchitecture` is not supported.
5353
3. Option `preferredGenerator` is not supported.
54-
4. Option `cmakeSettings` is not supported.
55-
5. Option `environmentSetupScript` is only supported in the experimental terminal mode.
54+
4. Option `environmentSetupScript` is only supported in the experimental terminal mode.

lua/cmake-tools/kits.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,11 @@ function kits.build_env_and_args(kit_name, escape, cwd, global_kits_path)
123123
if kit.toolchainFile then
124124
add_args({ "-DCMAKE_TOOLCHAIN_FILE:FILEPATH=" .. kit.toolchainFile })
125125
end
126+
if kit.cmakeSettings then
127+
for k, v in pairs(kit.cmakeSettings) do
128+
add_args({ "-D" .. k .. ":STRING=" .. v })
129+
end
130+
end
126131

127132
if kit.environmentVariables then
128133
for k, v in pairs(kit.environmentVariables) do

0 commit comments

Comments
 (0)