Skip to content

Commit 4be3c22

Browse files
committed
feat: add two getters
1 parent 5893fef commit 4be3c22

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

docs/howto.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ We provide a list of getters for you.
2727
cmake.is_cmake_project() -- return if current project is a cmake project
2828
cmake.has_cmake_preset() -- return if there exists cmake presets configuration
2929
cmake.get_build_target() -- return current build target
30+
cmake.get_build_target_path() -- reurn full path of current build target
3031
cmake.get_launch_target() -- return current launch target
32+
cmake.get_launch_target_path() -- return full path of current launch target
3133
cmake.get_launch_args() -- return args used by current launch target
3234
cmake.get_build_type() -- return current build type
3335
cmake.get_kit() -- return current using kit

lua/cmake-tools/init.lua

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,10 +1026,22 @@ function cmake.get_build_target()
10261026
return config.build_target
10271027
end
10281028

1029+
function cmake.get_build_target_path()
1030+
local result = config:get_build_target()
1031+
local target_path = result.data
1032+
return target_path
1033+
end
1034+
10291035
function cmake.get_launch_target()
10301036
return config.launch_target
10311037
end
10321038

1039+
function cmake.get_launch_target_path()
1040+
local result = config:get_launch_target()
1041+
local target_path = result.data
1042+
return target_path
1043+
end
1044+
10331045
function cmake.get_model_info()
10341046
return config:get_code_model_info()
10351047
end

0 commit comments

Comments
 (0)