Skip to content

Commit 17a332c

Browse files
committed
Added makefiles generator option.
1 parent 81895c3 commit 17a332c

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ This is a Docker container action.
2929
| `cmake_args` | _Additional arguments to pass to CMake._ | No | `""` |
3030
| `output_ignored_dirs` | _A space-separated list of directories to ignore when copying binary build artifacts. `CMakeFiles`, `pico-sdk`, `pioasm`, and `elf2uf2` are ignored regardless._ | No | `""` |
3131
| `cmake_config_only` | _Only configure CMake and generate build files. Do not build the project._ | No | `"false"` |
32+
| `makefiles_generator` | _CMake generator to use for generating build files._ | No | `"Ninja"` |
3233
<br>
3334

3435
## Outputs

action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ inputs:
5252
description: "Only configure CMake and generate build files. Do not build the project."
5353
required: false
5454
default: "false"
55+
makefiles_generator:
56+
description: "CMake generator to use for generating build files. Default is 'Ninja'."
57+
required: false
58+
default: "Ninja"
5559

5660
outputs:
5761
output_dir:
@@ -68,3 +72,4 @@ runs:
6872
- ${{ inputs.cmake_args }}
6973
- ${{ inputs.output_ignored_dirs }}
7074
- ${{ inputs.cmake_config_only }}
75+
- ${{ inputs.makefiles_generator }}

entrypoint.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ SOURCE_DIR="$1"
2626
OUTPUT_DIR="$2"
2727
OUTPUT_EXT="$3"
2828
BOARD_NAME="$4"
29-
CMAKE_ARGS="$5"
29+
CMAKE_ARGS=$5
3030
OUTPUT_IGNORED_DIRS="$6"
3131
CMAKE_CONFIG_ONLY="$7"
32+
MAKEFILES_GENERATOR="$8"
3233

3334
# Split output extensions and into array
3435
IFS=" " read -r -a BINARY_EXTENSIONS <<< "$OUTPUT_EXT"
@@ -52,6 +53,10 @@ if [ -z "$BOARD_NAME" ]; then
5253
BOARD_NAME="pico"
5354
fi
5455

56+
if [ -z "$MAKEFILES_GENERATOR" ]; then
57+
MAKEFILES_GENERATOR="Ninja"
58+
fi
59+
5560
if [ -z "$BINARY_EXTENSIONS" ]; then
5661
BINARY_EXTENSIONS=("*.uf2" "*.elf" "*.elf.map")
5762
fi
@@ -75,11 +80,13 @@ echo "BINARY_EXTENSIONS=${BINARY_EXTENSIONS[@]}"
7580
echo "BOARD_NAME=$BOARD_NAME"
7681
echo "CMAKE_ARGS=$CMAKE_ARGS"
7782
echo "IGNORED_BUILD_DIRS=${IGNORED_BUILD_DIRS[@]}"
83+
echo "CMAKE_CONFIG_ONLY=$CMAKE_CONFIG_ONLY"
84+
echo "MAKEFILES_GENERATOR=$MAKEFILES_GENERATOR"
7885

7986
# Build the project
8087
echo "Generating build files..."
8188
mkdir "$OUTPUT_DIR" && cd "$OUTPUT_DIR"
82-
cmake -DPICO_BOARD="$BOARD_NAME" $CMAKE_ARGS -S "$SOURCE_DIR" -B "$OUTPUT_DIR"
89+
cmake -DPICO_BOARD="$BOARD_NAME" -S "$SOURCE_DIR" -B "$OUTPUT_DIR" -G "$MAKEFILES_GENERATOR" $CMAKE_ARGS
8390

8491
if [ "$CMAKE_CONFIG_ONLY" = "false" ]; then
8592
echo "Building project..."

0 commit comments

Comments
 (0)