From d1034b5b62d12d6dc97f5fbe70c3984828a21b04 Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Sun, 8 Jan 2023 14:28:57 +0700 Subject: [PATCH] add `generator` input option --- action.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/action.yml b/action.yml index 801c3ea..ccb28c8 100644 --- a/action.yml +++ b/action.yml @@ -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