mirror of
https://github.com/threeal/cmake-action.git
synced 2025-04-21 19:11:21 +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:
parent
48cb08d783
commit
421f12e1db
6
main/index.mjs
generated
6
main/index.mjs
generated
@ -27245,6 +27245,12 @@ async function main() {
|
||||
const buildDir = _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput("build-dir");
|
||||
await _actions_exec__WEBPACK_IMPORTED_MODULE_1__.exec("cmake", [sourceDir || ".", "-B", buildDir || "build"]);
|
||||
_actions_core__WEBPACK_IMPORTED_MODULE_0__.setOutput("build-dir", buildDir || "build");
|
||||
const runBuild = _actions_core__WEBPACK_IMPORTED_MODULE_0__.getBooleanInput("run-build");
|
||||
if (runBuild) {
|
||||
const buildArgs = _actions_core__WEBPACK_IMPORTED_MODULE_0__.getMultilineInput("build-args")
|
||||
.flatMap((args) => args.split(" "));
|
||||
await _actions_exec__WEBPACK_IMPORTED_MODULE_1__.exec("cmake", ["--build", buildDir || "build", ...buildArgs]);
|
||||
}
|
||||
}
|
||||
main();
|
||||
//# sourceMappingURL=main.mjs.map
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user