add generator input option

This commit is contained in:
Alfi Maulana 2023-01-08 14:28:57 +07:00
parent f60f3407cc
commit d1034b5b62
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
required: false
default: build
generator:
description: The build system generator of the CMake project
required: false
c-compiler:
description: The preferred executable for compiling C language files
required: false
@ -30,6 +33,9 @@ runs:
run: |
CONFIGURE_ARGS="${{ inputs.source-dir }} -B ${{ inputs.build-dir }}"
BUILD_ARGS="--build ${{ inputs.build-dir }}"
if [ -n '${{ inputs.generator }}' ]; then
CONFIGURE_ARGS="$CONFIGURE_ARGS -G ${{ inputs.generator }}"
fi
if [ -n '${{ inputs.c-compiler }}' ]; then
CONFIGURE_ARGS="$CONFIGURE_ARGS -D CMAKE_C_COMPILER=${{ inputs.c-compiler }}"
fi