diff --git a/build-project/action.yml b/build-project/action.yml index 8abc2fe..232628d 100644 --- a/build-project/action.yml +++ b/build-project/action.yml @@ -19,6 +19,10 @@ inputs: description: 'Build project for the host system regardless of LCNTP_TARGET_PLATFORM environment variable' required: false default: 'false' + target: + description: 'Target to build' + required: false + default: '' outputs: install-prefix: description: "Path to installed files" diff --git a/build-project/builder.js b/build-project/builder.js index 383678c..b5a0059 100644 --- a/build-project/builder.js +++ b/build-project/builder.js @@ -119,7 +119,7 @@ module.exports = async options => { } } - const cacheKey = `build-project-${buildFolder.join("/")}-${calculateSHA256(cmakeArgs.join(" "))}`; + const cacheKey = `build-project-target${options.target}-${buildFolder.join("/")}-${calculateSHA256(cmakeArgs.join(" "))}`; let needBuild = true; if (options.project !== ".") { @@ -137,7 +137,12 @@ module.exports = async options => { if (needBuild) { await exec.exec(`cmake`, cmakeArgs); - await exec.exec(`cmake`, ["--build", buildDir]); + + const buildArgs = ["--build", buildDir]; + if (options.target) { + buildArgs.push("--target", options.target); + } + await exec.exec(`cmake`, buildArgs); } if (process.platform === "linux") { diff --git a/build-project/index.js b/build-project/index.js index eaa4576..de6ccce 100644 --- a/build-project/index.js +++ b/build-project/index.js @@ -8,11 +8,13 @@ async function run() { const extraCmakeArgs = core.getInput("extra-cmake-args"); const arch = core.getInput("arch"); const forceHostBuild = core.getInput("force-host-build"); + const target = core.getInput("target"); let options = { project: project, arch: arch, - forceHostBuild: forceHostBuild === "true" + forceHostBuild: forceHostBuild === "true", + target: target }; if (commitish) options.commitish = commitish;