From 4a0c14989854b2ddaf5e5ffbb531bb8e76db5691 Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Wed, 11 Jan 2023 15:38:28 +0700 Subject: [PATCH] add `targets` input option for specifying build targets --- action.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/action.yml b/action.yml index 63a5600..9bb2b43 100644 --- a/action.yml +++ b/action.yml @@ -13,6 +13,9 @@ inputs: description: The build directory of CMake project required: false default: build + targets: + description: List of build targets + required: false generator: description: The build system generator of the CMake project required: false @@ -33,6 +36,9 @@ runs: run: | ARGS="${{ inputs.source-dir }} -B ${{ inputs.build-dir }}" BUILD_ARGS="--build ${{ inputs.build-dir }}" + if [ -n '${{ inputs.targets }}' ]; then + BUILD_ARGS="$BUILD_ARGS --target ${{ inputs.targets }}" + fi if [ -n '${{ inputs.generator }}' ]; then ARGS="$ARGS -G ${{ inputs.generator }}" fi