mirror of
https://github.com/threeal/cmake-action.git
synced 2026-02-01 19:40:49 +00:00
feat: run CMake build from the JavaScript Action (#75)
* feat: add CMake build step * feat: only run CMake build step if `run-build` input is true * feat: pass `build-args` input to the CMake build command * fix: split lines from `getMultilineInput` with a whitespace
This commit is contained in:
@@ -6,6 +6,14 @@ async function main() {
|
||||
const buildDir = core.getInput("build-dir");
|
||||
await exec.exec("cmake", [sourceDir || ".", "-B", buildDir || "build"]);
|
||||
core.setOutput("build-dir", buildDir || "build");
|
||||
|
||||
const runBuild = core.getBooleanInput("run-build");
|
||||
if (runBuild) {
|
||||
const buildArgs = core
|
||||
.getMultilineInput("build-args")
|
||||
.flatMap((args) => args.split(" "));
|
||||
await exec.exec("cmake", ["--build", buildDir || "build", ...buildArgs]);
|
||||
}
|
||||
}
|
||||
|
||||
main();
|
||||
|
||||
Reference in New Issue
Block a user