From 04977998c256466479dcfa66f84396bd007e15a3 Mon Sep 17 00:00:00 2001 From: dragonmux Date: Wed, 29 Nov 2023 01:53:34 +0000 Subject: [PATCH] misc: Implemented an 'all' mode for the Meson build system --- include/meson.build | 14 ++++++++------ lib/meson.build | 2 +- lib/stm32/meson.build | 8 +++++++- meson_options.txt | 2 ++ 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/include/meson.build b/include/meson.build index ceaaf976..3ee983c4 100644 --- a/include/meson.build +++ b/include/meson.build @@ -34,9 +34,11 @@ target_paths = { 'stm32f1': 'stm32/f1' } -target_path = target_paths[target_platform] -subdir(f'libopencm3/@target_path@') - -target_vector_nvic = declare_dependency( - sources: target_nvic_header, -) +if target_platform != 'all' + target_path = target_paths[target_platform] + subdir(f'libopencm3/@target_path@') +else + foreach target_name, target_path : target_paths + subdir(f'libopencm3/@target_path@') + endforeach +endif diff --git a/lib/meson.build b/lib/meson.build index 3d28f47d..098ae129 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -36,6 +36,6 @@ subdir('cm3') locm3_ld_script_path = meson.current_source_dir() # Now take the platform target and map it to a suitable target family -if target_platform.startswith('stm32') +if target_platform.startswith('stm32') or target_platform == 'all' subdir('stm32') endif diff --git a/lib/stm32/meson.build b/lib/stm32/meson.build index 44eaacbd..13ea5b3a 100644 --- a/lib/stm32/meson.build +++ b/lib/stm32/meson.build @@ -52,4 +52,10 @@ subdirs = { } # Bring in the proper target subdir for the requested target platform -subdir(subdirs[target_platform]) +if target_platform != 'all' + subdir(subdirs[target_platform]) +else + foreach subdir_name, subdir_path : subdirs + subdir(subdir_path) + endforeach +endif diff --git a/meson_options.txt b/meson_options.txt index 5d6c0ee7..ec62a908 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -2,7 +2,9 @@ option( 'target', type: 'combo', choices: [ + 'all', 'stm32f1' ], + value: 'all', description: 'The hardware platform you wish to target' )