kopia lustrzana https://github.com/OpenRTX/OpenRTX
meson.build: changes to support building on MacOS
rodzic
1099f0f7a3
commit
ec56cad014
43
meson.build
43
meson.build
|
@ -323,7 +323,14 @@ linux_mod17_def = linux_def + {'CONFIG_SCREEN_WIDTH': '128', 'CONFIG_SCREEN_HEIG
|
||||||
|
|
||||||
linux_c_args = ['-ffunction-sections', '-fdata-sections']
|
linux_c_args = ['-ffunction-sections', '-fdata-sections']
|
||||||
linux_cpp_args = ['-ffunction-sections', '-fdata-sections', '-std=c++14']
|
linux_cpp_args = ['-ffunction-sections', '-fdata-sections', '-std=c++14']
|
||||||
linux_l_args = ['-lm', '-lreadline', '-Wl,--gc-sections']
|
linux_l_args = ['-lm', '-lreadline']
|
||||||
|
|
||||||
|
# MacOS Clang linker uses -deadstrip instead of --gc-sections
|
||||||
|
if build_machine.system() == 'darwin'
|
||||||
|
linux_l_args += '-Wl,-dead_strip'
|
||||||
|
else
|
||||||
|
linux_l_args += '-Wl,--gc-sections'
|
||||||
|
endif
|
||||||
|
|
||||||
# Add AddressSanitizer if required
|
# Add AddressSanitizer if required
|
||||||
if get_option('asan')
|
if get_option('asan')
|
||||||
|
@ -711,6 +718,8 @@ if build_machine.system() == 'linux'
|
||||||
bin2sgl = find_program('scripts/bin2sgl.Linux', required:false, disabler:true)
|
bin2sgl = find_program('scripts/bin2sgl.Linux', required:false, disabler:true)
|
||||||
elif build_machine.system() == 'windows'
|
elif build_machine.system() == 'windows'
|
||||||
bin2sgl = find_program('scripts/bin2sgl.exe', required:false, disabler:true)
|
bin2sgl = find_program('scripts/bin2sgl.exe', required:false, disabler:true)
|
||||||
|
elif build_machine.system() == 'darwin'
|
||||||
|
bin2sgl = find_program('scripts/bin2sgl.Darwin', required:false, disabler:true)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
radio_tool = find_program('radio_tool')
|
radio_tool = find_program('radio_tool')
|
||||||
|
@ -727,16 +736,7 @@ foreach t : targets
|
||||||
# ttwrplus is a Zephyr target, we compile it using west and package it in uf2 format
|
# ttwrplus is a Zephyr target, we compile it using west and package it in uf2 format
|
||||||
if name == 'openrtx_ttwrplus'
|
if name == 'openrtx_ttwrplus'
|
||||||
|
|
||||||
if build_machine.system() == 'linux'
|
if build_machine.system() == 'windows'
|
||||||
|
|
||||||
txt = custom_target('Copy CMakeLists.txt',
|
|
||||||
input : 'CMakeLists.txt',
|
|
||||||
output : 'CMakeLists.txt',
|
|
||||||
command : ['cp', '@INPUT@', '@OUTPUT@'],
|
|
||||||
install : false,
|
|
||||||
build_by_default : true)
|
|
||||||
|
|
||||||
elif build_machine.system() == 'windows'
|
|
||||||
|
|
||||||
txt = custom_target('Copy CMakeLists.txt',
|
txt = custom_target('Copy CMakeLists.txt',
|
||||||
input : 'CMakeLists.txt',
|
input : 'CMakeLists.txt',
|
||||||
|
@ -744,6 +744,14 @@ foreach t : targets
|
||||||
command : ['xcopy', '@INPUT@', '@OUTPUT@'],
|
command : ['xcopy', '@INPUT@', '@OUTPUT@'],
|
||||||
install : false,
|
install : false,
|
||||||
build_by_default : true)
|
build_by_default : true)
|
||||||
|
else # Unix-like OS that has cp
|
||||||
|
|
||||||
|
txt = custom_target('Copy CMakeLists.txt',
|
||||||
|
input : 'CMakeLists.txt',
|
||||||
|
output : 'CMakeLists.txt',
|
||||||
|
command : ['cp', '@INPUT@', '@OUTPUT@'],
|
||||||
|
install : false,
|
||||||
|
build_by_default : true)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -791,7 +799,12 @@ foreach t : targets
|
||||||
# Handle GD77 custom wrapping and flashing tools
|
# Handle GD77 custom wrapping and flashing tools
|
||||||
if name == 'openrtx_gd77' or name == 'openrtx_dm1801'
|
if name == 'openrtx_gd77' or name == 'openrtx_dm1801'
|
||||||
|
|
||||||
if build_machine.system() == 'linux'
|
if build_machine.system() == 'windows'
|
||||||
|
wrap = custom_target(name+'_wrap',
|
||||||
|
output : name+'_bin.sgl',
|
||||||
|
input : bin,
|
||||||
|
command : [bin2sgl, '@INPUT@', '-m', t['wrap']])
|
||||||
|
else # Unix-like OS that has mv
|
||||||
wrap = custom_target(name+'_wrap',
|
wrap = custom_target(name+'_wrap',
|
||||||
output : name+'_wrap.sgl',
|
output : name+'_wrap.sgl',
|
||||||
input : bin,
|
input : bin,
|
||||||
|
@ -800,12 +813,6 @@ foreach t : targets
|
||||||
'-m', t['wrap'],
|
'-m', t['wrap'],
|
||||||
'&&',
|
'&&',
|
||||||
'mv', '@INPUT@.sgl', '@OUTPUT@'])
|
'mv', '@INPUT@.sgl', '@OUTPUT@'])
|
||||||
|
|
||||||
elif build_machine.system() == 'windows'
|
|
||||||
wrap = custom_target(name+'_wrap',
|
|
||||||
output : name+'_bin.sgl',
|
|
||||||
input : bin,
|
|
||||||
command : [bin2sgl, '@INPUT@', '-m', t['wrap']])
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
custom_target(name+'_flash',
|
custom_target(name+'_flash',
|
||||||
|
|
Plik binarny nie jest wyświetlany.
Ładowanie…
Reference in New Issue