Skip to content

Commit 309470b

Browse files
committed
make sure there's no recursion
1 parent d064d9f commit 309470b

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

lua/cmake-tools/init.lua

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,11 @@ function cmake.build(opt, callback)
329329
-- configure it
330330
return cmake.generate({ bang = false, fargs = {} }, function(result)
331331
if result:is_ok() then
332-
cmake.build(opt, callback)
332+
if
333+
config:has_build_directory() and config:get_codemodel_targets().code == Types.SUCCESS
334+
then
335+
cmake.build(opt, callback)
336+
end
333337
else
334338
callback(result)
335339
end
@@ -1131,7 +1135,11 @@ function cmake.run_test(opt, callback)
11311135
-- configure it
11321136
return cmake.generate({ bang = false, fargs = {} }, function(result)
11331137
if result:is_ok() then
1134-
cmake.run_test(opt, callback)
1138+
if
1139+
config:has_build_directory() and config:get_codemodel_targets().code == Types.SUCCESS
1140+
then
1141+
cmake.run_test(opt, callback)
1142+
end
11351143
else
11361144
callback(result)
11371145
end

0 commit comments

Comments
 (0)