diff --git a/meson.build b/meson.build new file mode 100644 --- /dev/null +++ b/meson.build @@ -0,0 +1,20 @@ +project('LFR_FSW', 'c') +add_global_arguments( + '-DSW_VERSION_N1=@0@'.format(get_option('SW_VERSION_N1')), + '-DSW_VERSION_N2=@0@'.format(get_option('SW_VERSION_N2')), + '-DSW_VERSION_N3=@0@'.format(get_option('SW_VERSION_N3')), + '-DSW_VERSION_N4=@0@'.format(get_option('SW_VERSION_N4')), + language: 'c' + ) + +subdir('LFR_basic-parameters') +subdir('src') + +cppcheck = find_program('cppcheck', required : false) + +if cppcheck.found() + run_target('cppcheck', + command : [cppcheck, '--enable=all', + '--project=' + join_paths(meson.build_root(), 'compile_commands.json')] + ) +endif diff --git a/meson.build.user b/meson.build.user new file mode 100644 --- /dev/null +++ b/meson.build.user @@ -0,0 +1,345 @@ + + + + + + EnvironmentId + {8296a704-4601-4320-a983-0ab0824e1a9c} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + + Nim + + NimGlobal + + + 3 + UTF-8 + false + 4 + true + 80 + true + true + 1 + true + false + 0 + true + true + 0 + 8 + true + false + 1 + true + true + true + *.md, *.MD, Makefile + false + true + + + + ProjectExplorer.Project.PluginSettings + + + true + false + true + true + true + true + + + 0 + true + + true + Builtin.Questionable + + true + true + Builtin.DefaultTidyAndClazy + 16 + + + + true + + + + + ProjectExplorer.Project.Target.0 + + Desktop + Desktop + Desktop + {f6d37441-4146-4246-9b7c-dee7995dc10f} + 0 + 0 + 0 + + --cross-file sparc-cross.ini + debug + /home/jeandet/Documents/prog/LFR_FSW/../build-LFR_FSW-Desktop-debug + + + + all + true + Build + MesonProjectManager.BuildStep + + 1 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + + clean + true + Build + MesonProjectManager.BuildStep + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + + Debug + MesonProjectManager.BuildConfiguration + + + + release + /home/jeandet/Documents/prog/LFR_FSW/../build-LFR_FSW-Desktop-release + + + + all + true + MesonProjectManager.BuildStep + + 1 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + + clean + true + MesonProjectManager.BuildStep + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + + Release + MesonProjectManager.BuildConfiguration + + + + debugoptimized + /home/jeandet/Documents/prog/LFR_FSW/../build-LFR_FSW-Desktop-debugoptimized + + + + all + true + MesonProjectManager.BuildStep + + 1 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + + clean + true + MesonProjectManager.BuildStep + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + + Debug With Optimizations + MesonProjectManager.BuildConfiguration + + + + minsize + /home/jeandet/Documents/prog/LFR_FSW/../build-LFR_FSW-Desktop-minsize + + + + all + true + MesonProjectManager.BuildStep + + 1 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + + clean + true + MesonProjectManager.BuildStep + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + + Minimum Size + MesonProjectManager.BuildConfiguration + + 4 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + + false + ProjectExplorer.DefaultDeployConfiguration + + 1 + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + + 2 + + fsw + MesonProjectManager.MesonRunConfiguration/src/fsw + /src/fsw + false + true + true + false + true + /home/jeandet/Documents/prog/build-LFR_FSW-Desktop-debug/src + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 22 + + + Version + 22 + + diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,4 @@ +option('SW_VERSION_N1', type : 'string', value : '3', description : 'N1 FSW Version.') +option('SW_VERSION_N2', type : 'string', value : '2', description : 'N2 FSW Version.') +option('SW_VERSION_N3', type : 'string', value : '0', description : 'N3 FSW Version.') +option('SW_VERSION_N4', type : 'string', value : '24', description : 'N4 FSW Version.') diff --git a/sparc-cross.ini b/sparc-cross.ini new file mode 100644 --- /dev/null +++ b/sparc-cross.ini @@ -0,0 +1,20 @@ +[host_machine] +system = 'rtems' +cpu_family = 'sparc' +cpu = 'sparc' +endian = 'big' + +[constants] +toolchain = '/opt/rtems-4.10/' +prefix = 'sparc-rtems' +common_flags = ['-O2', '-I' + toolchain + 'sparc-rtems/leon3/lib/include'] + +[properties] +c_args = common_flags +cpp_args = c_args + +[binaries] +c = toolchain + 'bin/' + prefix + '-gcc' +cpp = toolchain + 'bin/' + prefix + '-g++' +strip = toolchain + 'bin/' + prefix + '-strip' + diff --git a/src/meson.build b/src/meson.build new file mode 100644 --- /dev/null +++ b/src/meson.build @@ -0,0 +1,58 @@ +fsw_inc = include_directories( + '../header', + '../header/lfr_common_headers', + '../header/processing', + '../LFR_basic-parameters', + '../src' + ) + +fsw_srcs = files( + 'wf_handler.c', + 'tc_handler.c', + 'fsw_misc.c', + 'fsw_init.c', + 'fsw_globals.c', + 'fsw_spacewire.c', + 'tc_load_dump_parameters.c', + 'tm_lfr_tc_exe.c', + 'tc_acceptance.c', + 'processing/fsw_processing.c', + 'processing/avf0_prc0.c', + 'processing/avf1_prc1.c', + 'processing/avf2_prc2.c', + 'lfr_cpu_usage_report.c' +) + +fsw_extra_files = files( + '../header/wf_handler.h', + '../header/tc_handler.h', + '../header/grlib_regs.h', + '../header/fsw_misc.h', + '../header/fsw_init.h', + '../header/fsw_spacewire.h', + '../header/tc_load_dump_parameters.h', + '../header/tm_lfr_tc_exe.h', + '../header/tc_acceptance.h', + '../header/processing/fsw_processing.h', + '../header/processing/avf0_prc0.h', + '../header/processing/avf1_prc1.h', + '../header/processing/avf2_prc2.h', + '../header/fsw_params_wf_handler.h', + '../header/lfr_cpu_usage_report.h', + '../header/lfr_common_headers/ccsds_types.h', + '../header/lfr_common_headers/fsw_params.h', + '../header/lfr_common_headers/fsw_params_nb_bytes.h', + '../header/lfr_common_headers/fsw_params_processing.h', + '../header/lfr_common_headers/tm_byte_positions.h', + '../LFR_basic-parameters/basic_parameters.h', + '../LFR_basic-parameters/basic_parameters_params.h', + '../header/GscMemoryLPP.hpp' +) + +cc = meson.get_compiler('c') +m_dep = cc.find_library('m', required : false) + +fsw = executable('fsw', fsw_srcs, + include_directories: fsw_inc, + dependencies:[lfr_bp_dep, m_dep], + extra_files: fsw_extra_files) diff --git a/tests/meson.build b/tests/meson.build new file mode 100644 --- /dev/null +++ b/tests/meson.build @@ -0,0 +1,49 @@ +project('Name', 'cpp',default_options : ['cpp_std=c++14']) + +#qt5 = import('qt5') +#qt5core = dependency('qt5', modules : 'Core') +#qt5widgets = dependency('qt5', modules : 'Widgets') +#qt5gui = dependency('qt5', modules : 'Gui') +#qt5svg = dependency('qt5', modules : 'Svg') +#qt5xml = dependency('qt5', modules : 'Xml') +#qt5network = dependency('qt5', modules : 'Network') +#qt5printsupport = dependency('qt5', modules : 'PrintSupport') +#qt5test = dependency('qt5', modules : 'Test') + +subdir('src') + +#if build_machine.system()=='darwin' +# install_data('build_cfg/mac/sciqlopLOGO.icns', install_dir : 'Contents/Resources') +# install_data('build_cfg/mac/Info.plist', install_dir : 'Contents') +# meson.add_install_script('build_cfg/mac/install_script.sh') +#elif host_machine.system()=='windows' +# meson.add_install_script('build_cfg/windows/install_script.sh') +#endif + +my_inc = include_directories(['include']) + +my_lib = library('lib_name', + gui_sources, + gui_moc_files, + link_with : sciqlop_core, + include_directories : [my_inc], + dependencies : [qt5core, qt5printsupport, qt5gui, qt5widgets, qt5network], + install : true + ) + +my_app = executable('exe_name', + [], + link_with : [my_lib], + include_directories : [my_inc], + dependencies : [qt5core, qt5printsupport, qt5gui, qt5widgets, qt5network], + install : true + ) + +cppcheck = find_program('cppcheck', required : false) + +if cppcheck.found() + run_target('cppcheck', + command : [cppcheck, '--enable=all', + '--project=' + join_paths(meson.build_root(), 'compile_commands.json')] + ) +endif