From 75b1d343efc0e7e39c3b06019b989b8c58972567 Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Sat, 14 Jan 2023 17:16:54 +0700 Subject: [PATCH] add compiler flags inputs option --- action.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/action.yml b/action.yml index f2e549a..35b63a4 100644 --- a/action.yml +++ b/action.yml @@ -25,6 +25,12 @@ inputs: cxx-compiler: description: Preferred executable for compiling CXX language files required: false + c-flags: + description: Additional flags passed when compiling C language files + required: false + cxx-flags: + description: Additional flags passed when compiling C++ language files + required: false args: description: Additional arguments passed during the CMake configuration required: false @@ -49,6 +55,12 @@ runs: if [ -n '${{ inputs.cxx-compiler }}' ]; then ARGS="$ARGS -D CMAKE_CXX_COMPILER=${{ inputs.cxx-compiler }}" fi + if [ -n '${{ inputs.c-flags }}' ]; then + ARGS="$ARGS -D CMAKE_C_FLAGS=${{ inputs.c-flags }}" + fi + if [ -n '${{ inputs.cxx-flags }}' ]; then + ARGS="$ARGS -D CMAKE_CXX_FLAGS=${{ inputs.cxx-flags }}" + fi if [ -n '${{ inputs.args }}' ]; then ARGS="$ARGS ${{ inputs.args }}" fi