From 831cc540a74aec1e322c5e465513756232ed16bd 2017-08-28 20:26:41 From: Alexis Jeandet Date: 2017-08-28 20:26:41 Subject: [PATCH] Some Meson improvements, now declare dependency for each lib to propagate options. Signed-off-by: Alexis Jeandet --- diff --git a/app/meson.build b/app/meson.build index 4e5b793..a509264 100644 --- a/app/meson.build +++ b/app/meson.build @@ -31,9 +31,8 @@ sciqlop_app = executable('sciqlop', app_sources, app_moc_files, rc, - link_with : [sciqlop_core, sciqlop_gui], - include_directories : [gui_inc, core_inc, app_inc], - dependencies : [qt5core, qt5printsupport, qt5gui, qt5widgets, qt5network], + include_directories : [ app_inc], + dependencies : [sciqlop_gui, sciqlop_core], install : true ) diff --git a/core/meson.build b/core/meson.build index d0b65d6..bb77c2e 100644 --- a/core/meson.build +++ b/core/meson.build @@ -43,14 +43,20 @@ core_sources = [ core_inc = include_directories(['include', '../plugin/include']) -sciqlop_core = library('sciqlopcore', +sciqlop_core_lib = library('sciqlopcore', core_sources, core_moc_files, cpp_args : '-DCORE_LIB', include_directories : core_inc, - dependencies : [qt5core, qt5widgets, qt5network], + dependencies : [qt5core, qt5network], install : true ) + +sciqlop_core = declare_dependency(link_with : sciqlop_core_lib, + include_directories : core_inc, + dependencies : [qt5core, qt5network]) + + subdir('tests') diff --git a/core/tests/meson.build b/core/tests/meson.build index d9ec423..7f15f45 100644 --- a/core/tests/meson.build +++ b/core/tests/meson.build @@ -12,9 +12,7 @@ tests = [ foreach unit_test : tests test_moc_files = qt5.preprocess(moc_sources : unit_test[0]) test_exe = executable(unit_test[1],unit_test[0] , test_moc_files, - link_with : sciqlop_core, - include_directories : core_inc, - dependencies : [qt5core, qt5widgets, qt5network,qt5test]) + dependencies : [sciqlop_core, qt5test]) test(unit_test[2], test_exe, args: ['-teamcity', '-o', '@0@.teamcity.txt'.format(unit_test[1])]) endforeach diff --git a/gui/meson.build b/gui/meson.build index 19716e6..db498e7 100644 --- a/gui/meson.build +++ b/gui/meson.build @@ -61,12 +61,15 @@ gui_sources = [ gui_inc = include_directories(['include']) -sciqlop_gui = library('sciqlopgui', +sciqlop_gui_lib = library('sciqlopgui', gui_sources, gui_moc_files, - link_with : sciqlop_core, - include_directories : [gui_inc, core_inc], - dependencies : [qt5core, qt5printsupport, qt5gui, qt5widgets, qt5network], + include_directories : [gui_inc], + dependencies : [ qt5printsupport, qt5gui, qt5widgets, qt5svg, sciqlop_core], install : true ) +sciqlop_gui = declare_dependency(link_with : sciqlop_gui_lib, + include_directories : gui_inc, + dependencies : [qt5printsupport, qt5gui, qt5widgets, qt5svg, sciqlop_core]) + diff --git a/plugins/amda/meson.build b/plugins/amda/meson.build index 6f836de..480de27 100644 --- a/plugins/amda/meson.build +++ b/plugins/amda/meson.build @@ -49,9 +49,8 @@ sciqlop_amdaplugin = library('amdaplugin', amdaplugin_rcc_plugin_files, amdaplugin_moc_plugin_files, cpp_args : ['-DAMDA_LIB','-DQT_PLUGIN'], - link_with : [sciqlop_core, sciqlop_gui], - include_directories : [amdaplugin_inc, core_inc, gui_inc], - dependencies : [qt5core, qt5gui, qt5widgets, qt5network], + include_directories : [amdaplugin_inc], + dependencies : [sciqlop_core, sciqlop_gui], install : true ) @@ -65,9 +64,9 @@ tests = [ foreach unit_test : tests test_moc_files = qt5.preprocess(moc_sources : unit_test[0]) test_exe = executable(unit_test[1],unit_test[0] , test_moc_files, - link_with : [sciqlop_core, sciqlop_amdaplugin, sciqlop_gui], - include_directories : [core_inc, amdaplugin_inc, gui_inc], + link_with : [sciqlop_amdaplugin], + include_directories : [amdaplugin_inc], cpp_args : ['-DAMDA_TESTS_RESOURCES_DIR="'+meson.current_source_dir()+'/tests-resources"'], - dependencies : [qt5core, qt5widgets, qt5network,qt5test]) + dependencies : [sciqlop_core, sciqlop_gui, qt5test]) test(unit_test[2], test_exe, args: ['-teamcity', '-o', '@0@.teamcity.txt'.format(unit_test[1])], timeout: 3 * 60) endforeach diff --git a/plugins/mockplugin/meson.build b/plugins/mockplugin/meson.build index 323d14b..91bb964 100644 --- a/plugins/mockplugin/meson.build +++ b/plugins/mockplugin/meson.build @@ -25,9 +25,8 @@ sciqlop_mockplugin = library('mockplugin', mockplugin_sources, mockplugin_moc_files, cpp_args : '-DMOCKPLUGIN_LIB', - link_with : [sciqlop_core, sciqlop_gui], - include_directories : [mockplugin_inc, core_inc, gui_inc], - dependencies : [qt5core, qt5gui, qt5widgets, qt5network], + include_directories : [mockplugin_inc], + dependencies : [sciqlop_core, sciqlop_gui], install : true )