mirror of
https://github.com/threeal/cmake-action.git
synced 2025-06-09 10:41:22 +00:00
feat: parse and pass options
input
This commit is contained in:
parent
7dcde4d2ac
commit
3c93417fee
4
main/index.mjs
generated
4
main/index.mjs
generated
@ -27259,6 +27259,10 @@ async function main() {
|
|||||||
const cxxFlags = _actions_core__WEBPACK_IMPORTED_MODULE_0__.getMultilineInput("cxx-flags").join(" ");
|
const cxxFlags = _actions_core__WEBPACK_IMPORTED_MODULE_0__.getMultilineInput("cxx-flags").join(" ");
|
||||||
if (cxxFlags)
|
if (cxxFlags)
|
||||||
configureArgs.push("-DCMAKE_CXX_FLAGS=" + cxxFlags);
|
configureArgs.push("-DCMAKE_CXX_FLAGS=" + cxxFlags);
|
||||||
|
const options = _actions_core__WEBPACK_IMPORTED_MODULE_0__.getMultilineInput("options")
|
||||||
|
.flatMap((opts) => opts.split(" "))
|
||||||
|
.map((opt) => "-D" + opt);
|
||||||
|
configureArgs.push(...options);
|
||||||
await _actions_exec__WEBPACK_IMPORTED_MODULE_1__.exec("cmake", configureArgs);
|
await _actions_exec__WEBPACK_IMPORTED_MODULE_1__.exec("cmake", configureArgs);
|
||||||
_actions_core__WEBPACK_IMPORTED_MODULE_0__.setOutput("build-dir", buildDir || "build");
|
_actions_core__WEBPACK_IMPORTED_MODULE_0__.setOutput("build-dir", buildDir || "build");
|
||||||
const runBuild = _actions_core__WEBPACK_IMPORTED_MODULE_0__.getBooleanInput("run-build");
|
const runBuild = _actions_core__WEBPACK_IMPORTED_MODULE_0__.getBooleanInput("run-build");
|
||||||
|
@ -22,6 +22,12 @@ async function main() {
|
|||||||
const cxxFlags = core.getMultilineInput("cxx-flags").join(" ");
|
const cxxFlags = core.getMultilineInput("cxx-flags").join(" ");
|
||||||
if (cxxFlags) configureArgs.push("-DCMAKE_CXX_FLAGS=" + cxxFlags);
|
if (cxxFlags) configureArgs.push("-DCMAKE_CXX_FLAGS=" + cxxFlags);
|
||||||
|
|
||||||
|
const options = core
|
||||||
|
.getMultilineInput("options")
|
||||||
|
.flatMap((opts) => opts.split(" "))
|
||||||
|
.map((opt) => "-D" + opt);
|
||||||
|
configureArgs.push(...options);
|
||||||
|
|
||||||
await exec.exec("cmake", configureArgs);
|
await exec.exec("cmake", configureArgs);
|
||||||
core.setOutput("build-dir", buildDir || "build");
|
core.setOutput("build-dir", buildDir || "build");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user