Change directory structure

This commit is contained in:
2024-05-03 18:28:51 +02:00
parent b8d625f85e
commit 2ef96e965b
69 changed files with 50 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
return {
name = "CMake Build",
builder = function()
local file = vim.fn.expand("%:p")
return {
cmd = {
"cmake"
},
args = {
"--build",
"build",
"-j16"
},
components = {
{
"on_output_quickfix"
},
"default"
}
}
end,
condition = {
filetype = {
"cmake",
"cpp"
}
}
}

View File

@@ -0,0 +1,24 @@
return {
name = "CMake Clean",
builder = function()
local file = vim.fn.expand("%:p")
return {
cmd = {
"rm"
},
args = {
"-r",
"build",
},
components = {
"default"
}
}
end,
condition = {
filetype = {
"cmake",
"cpp"
}
}
}

View File

@@ -0,0 +1,58 @@
return {
name = "CMake Generate",
params = {
build_type = {
type = "enum",
choices = {
"Debug",
"Release",
"RelWithDebInfo",
"MinSizeRel"
},
default = "Debug"
},
generator = {
type = "enum",
choices = {
"Ninja",
"Unix Makefiles"
},
default = "Ninja"
},
compiler = {
type = "enum",
choices = {
"g++",
"clang++"
},
default = "g++"
}
},
builder = function(params)
return {
cmd = {
"cmake"
},
args = {
"-B",
"build",
"-S",
".",
"-DCMAKE_EXPORT_COMPILE_COMMANDS=ON",
"-DCMAKE_BUILD_TYPE=" .. params.build_type,
"-DCMAKE_CXX_COMPILER=" .. params.compiler,
"-G",
params.generator
},
components = {
"default"
}
}
end,
condition = {
filetype = {
"cmake",
"cpp"
}
}
}

View File

@@ -0,0 +1,27 @@
return {
name = "CMake Test",
builder = function()
return {
cmd = {
"ctest"
},
args = {
"--test-dir",
"build",
"--output-on-failure",
},
components = {
{
"on_output_quickfix"
},
"default"
}
}
end,
condition = {
filetype = {
"cmake",
"cpp"
}
}
}

View File

@@ -0,0 +1,22 @@
return {
name = "Python Run",
builder = function()
local file = vim.fn.expand("%:p")
return {
cmd = {
"python"
},
args = {
file
},
components = {
"default"
}
}
end,
condition = {
filetype = {
"python"
}
}
}