meson.build: created three separate linux targets for different build configurations

pull/227/head
marco 2023-12-30 15:03:57 +01:00 zatwierdzone przez Silvano Seva
rodzic 7987bd732f
commit 0e6473f95e
1 zmienionych plików z 70 dodań i 15 usunięć

Wyświetl plik

@ -279,19 +279,6 @@ linux_inc = ['platform/targets/linux',
linux_def = {'PLATFORM_LINUX': '', 'VP_USE_FILESYSTEM':''}
#
# Standard UI
#
linux_src += ui_src_default
linux_def += {'SCREEN_WIDTH': '160', 'SCREEN_HEIGHT': '128', 'PIX_FMT_RGB565': ''}
#
# Module17 UI
#
# linux_src += ui_src_module17
# linux_def += {'SCREEN_WIDTH': '128', 'SCREEN_HEIGHT': '64', 'PIX_FMT_BW': ''}
sdl_dep = dependency('SDL2', required: false)
threads_dep = dependency('threads', required: false)
pulse_dep = dependency('libpulse', required: false)
@ -299,6 +286,19 @@ linux_src += openrtx_src
linux_inc += openrtx_inc
linux_def += openrtx_def
#
# Standard UI
#
linux_default_src = linux_src + ui_src_default
linux_default_def = linux_def + {'SCREEN_WIDTH': '160', 'SCREEN_HEIGHT': '128', 'PIX_FMT_RGB565': ''}
linux_small_def = linux_def + {'SCREEN_WIDTH': '128', 'SCREEN_HEIGHT': '64', 'PIX_FMT_BW': ''}
#
# Module17 UI
#
linux_mod17_src = linux_src + ui_src_module17
linux_mod17_def = linux_def + {'SCREEN_WIDTH': '128', 'SCREEN_HEIGHT': '64', 'PIX_FMT_BW': ''}
linux_c_args = ['-ffunction-sections', '-fdata-sections']
linux_cpp_args = ['-ffunction-sections', '-fdata-sections', '-std=c++14']
linux_l_args = ['-lm', '-lreadline', '-lpulse-simple', '-Wl,--gc-sections']
@ -427,7 +427,14 @@ mod17_def += openrtx_def + stm32f405_def + miosix_cm4f_def
## -------------------------- Compilation arguments ----------------------------
##
foreach k, v : linux_def
linux_c_args = linux_c_args
linux_cpp_args = linux_cpp_args
linux_small_c_args = linux_c_args
linux_small_cpp_args = linux_cpp_args
linux_mod17_c_args = linux_c_args
linux_mod17_cpp_args = linux_cpp_args
foreach k, v : linux_default_def
if v == ''
linux_c_args += '-D@0@'.format(k)
linux_cpp_args += '-D@0@'.format(k)
@ -437,6 +444,26 @@ foreach k, v : linux_def
endif
endforeach
foreach k, v : linux_small_def
if v == ''
linux_small_c_args += '-D@0@'.format(k)
linux_small_cpp_args += '-D@0@'.format(k)
else
linux_small_c_args += '-D@0@=@1@'.format(k, v)
linux_small_cpp_args += '-D@0@=@1@'.format(k, v)
endif
endforeach
foreach k, v : linux_mod17_def
if v == ''
linux_mod17_c_args += '-D@0@'.format(k)
linux_mod17_cpp_args += '-D@0@'.format(k)
else
linux_mod17_c_args += '-D@0@=@1@'.format(k, v)
linux_mod17_cpp_args += '-D@0@=@1@'.format(k, v)
endif
endforeach
md3x0_args = []
foreach k, v : md3x0_def
if v == ''
@ -492,7 +519,7 @@ foreach k, v : mod17_def
endforeach
linux_opts = {
'sources' : linux_src,
'sources' : linux_default_src,
'include_directories': linux_inc,
'dependencies' : [sdl_dep, threads_dep, pulse_dep, codec2_dep],
'c_args' : linux_c_args,
@ -500,6 +527,24 @@ linux_opts = {
'link_args' : linux_l_args
}
linux_small_opts = {
'sources' : linux_default_src,
'include_directories': linux_inc,
'dependencies' : [sdl_dep, threads_dep, pulse_dep, codec2_dep],
'c_args' : linux_small_c_args,
'cpp_args' : linux_small_cpp_args,
'link_args' : linux_l_args
}
linux_mod17_opts = {
'sources' : linux_mod17_src,
'include_directories': linux_inc,
'dependencies' : [sdl_dep, threads_dep, pulse_dep, codec2_dep],
'c_args' : linux_mod17_c_args,
'cpp_args' : linux_mod17_cpp_args,
'link_args' : linux_l_args
}
md3x0_opts = {
'sources' : md3x0_src,
'include_directories': md3x0_inc,
@ -579,6 +624,16 @@ targets = [
'opts' : linux_opts,
'flashable': false
},
{
'name' : 'linux_smallscreen',
'opts' : linux_small_opts,
'flashable': false
},
{
'name' : 'linux_mod17',
'opts' : linux_mod17_opts,
'flashable': false
},
{
'name' : 'md3x0',
'opts' : md3x0_opts,