mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-26 21:51:13 +01:00
dagger
allow for custom targets via parameter
This commit is contained in:
+5
-1
@@ -117,6 +117,10 @@ func (m *UnisimCpp) Build(
|
|||||||
// +defaultPath="/"
|
// +defaultPath="/"
|
||||||
// +ignore=["build", "docs"]
|
// +ignore=["build", "docs"]
|
||||||
src *dagger.Directory,
|
src *dagger.Directory,
|
||||||
|
// List of CMake targets to build (e.g., "all", "myapp", "tests")
|
||||||
|
// +optional
|
||||||
|
// +default=["all"]
|
||||||
|
targets []string,
|
||||||
) (*dagger.Directory, error) {
|
) (*dagger.Directory, error) {
|
||||||
ctr := dag.Container().From("quay.io/sani7/qt-build:latest")
|
ctr := dag.Container().From("quay.io/sani7/qt-build:latest")
|
||||||
output := ctr.
|
output := ctr.
|
||||||
@@ -127,7 +131,7 @@ func (m *UnisimCpp) Build(
|
|||||||
// execute build commands
|
// execute build commands
|
||||||
WithExec([]string{"cmake", "-S", ".", "-B", "build", "-G", "Ninja"}).
|
WithExec([]string{"cmake", "-S", ".", "-B", "build", "-G", "Ninja"}).
|
||||||
// Flags after `--` are transmitted as-is to the build system (Ninja, here)
|
// Flags after `--` are transmitted as-is to the build system (Ninja, here)
|
||||||
WithExec([]string{"cmake", "--build", "build", "--clean-first", "--target", "all"}).
|
WithExec(append([]string{"cmake", "--build", "build", "--target"}, targets...)).
|
||||||
Directory(".")
|
Directory(".")
|
||||||
return output.Sync(ctx)
|
return output.Sync(ctx)
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user