aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lua/cmake/actions.lua2
-rw-r--r--lua/cmake/config.lua24
-rw-r--r--lua/cmake/project.lua2
3 files changed, 14 insertions, 14 deletions
diff --git a/lua/cmake/actions.lua b/lua/cmake/actions.lua
index 0eff4ed..d17096c 100644
--- a/lua/cmake/actions.lua
+++ b/lua/cmake/actions.lua
@@ -251,7 +251,7 @@ M.edit_variants = function()
vim.cmd(string.format("e %s", constants.variants_yaml_filename))
end)
else
- local default_yaml = require("cmake.lyaml").dump(config.cmake.variants)
+ local default_yaml = require("cmake.lyaml").dump(config.variants)
utils.write_file(constants.variants_yaml_filename, default_yaml, function()
vim.schedule(function()
vim.cmd(string.format("e %s", constants.variants_yaml_filename))
diff --git a/lua/cmake/config.lua b/lua/cmake/config.lua
index 4bf49ba..25ae976 100644
--- a/lua/cmake/config.lua
+++ b/lua/cmake/config.lua
@@ -4,6 +4,7 @@
---@field generate_after_save boolean Generate after saving `CMakeLists.txt` file
---@field cmake_terminal CMakeConfigCMakeTerminal Settings for terminal where cmake will be executed
---@field target_terminal CMakeConfigTargetTerminal Settings for terminal where executable targets will be executed
+---@field variants {[string]:CMakeVariant} Default variants. Parameters defined in variants have more priority than defined in `cmake = {...}` ones
---@class CMakeConfigCMake
---@field cmake_path string Path to `cmake` executable
@@ -13,7 +14,6 @@
---@field build_tool_args string[] An array of additional arguments to pass to the underlying build tool
---@field generator? string Set to a string to override CMake Tools’ preferred generator logic. If this is set, CMake will unconditionally use it as the -G CMake generator command line argument
---@field parallel_jobs? number By specifying a number, you can define how many jobs are run in parallel during the build
----@field variants {[string]:CMakeVariant} Default variants. Parameters defined in variants have more priority than defined in `cmake = {...}` ones
---@class CMakeVariant
---@field default string Default choice
@@ -58,19 +58,19 @@ local default_config = {
build_args = {},
build_tool_args = {},
generator = nil,
- variants = {
- buildType = {
- default = "debug",
- description = "Build type",
- choices = {
- debug = { short = "Debug", buildType = "Debug" },
- release = { short = "Release", buildType = "Release" },
- relWithDebInfo = { short = "Release with debug info", buildType = "RelWithDebInfo" },
- minSizeRel = { short = "Minimal size releaze", buildType = "MinSizeRel" },
- },
+ parallel_jobs = nil,
+ },
+ variants = {
+ buildType = {
+ default = "debug",
+ description = "Build type",
+ choices = {
+ debug = { short = "Debug", buildType = "Debug" },
+ release = { short = "Release", buildType = "Release" },
+ relWithDebInfo = { short = "Release with debug info", buildType = "RelWithDebInfo" },
+ minSizeRel = { short = "Minimal size releaze", buildType = "MinSizeRel" },
},
},
- parallel_jobs = nil,
},
save_before_build = true,
generate_after_save = true,
diff --git a/lua/cmake/project.lua b/lua/cmake/project.lua
index f5afde2..5524fbd 100644
--- a/lua/cmake/project.lua
+++ b/lua/cmake/project.lua
@@ -287,7 +287,7 @@ local do_setup = function(opts)
Project.from_variants(yaml)
end)
else
- Project.from_variants(config.cmake.variants)
+ Project.from_variants(config.variants)
end
end)
end