misc: Implemented an 'all' mode for the Meson build system

This commit is contained in:
dragonmux
2023-11-29 01:53:34 +00:00
committed by Piotr Esden-Tempski
parent e1746a04ae
commit 04977998c2
4 changed files with 18 additions and 8 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -2,7 +2,9 @@ option(
'target',
type: 'combo',
choices: [
'all',
'stm32f1'
],
value: 'all',
description: 'The hardware platform you wish to target'
)