add targets input option for specifying build targets

This commit is contained in:
Alfi Maulana 2023-01-11 15:38:28 +07:00
parent 4ba6e49b5d
commit 4a0c149898
No known key found for this signature in database
GPG Key ID: 2242A64C2A8DF5A4

View File

@ -13,6 +13,9 @@ inputs:
description: The build directory of CMake project description: The build directory of CMake project
required: false required: false
default: build default: build
targets:
description: List of build targets
required: false
generator: generator:
description: The build system generator of the CMake project description: The build system generator of the CMake project
required: false required: false
@ -33,6 +36,9 @@ runs:
run: | run: |
ARGS="${{ inputs.source-dir }} -B ${{ inputs.build-dir }}" ARGS="${{ inputs.source-dir }} -B ${{ inputs.build-dir }}"
BUILD_ARGS="--build ${{ 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 if [ -n '${{ inputs.generator }}' ]; then
ARGS="$ARGS -G ${{ inputs.generator }}" ARGS="$ARGS -G ${{ inputs.generator }}"
fi fi