From 3c06155696257fb58ee17f31765b56293fec4c98 Mon Sep 17 00:00:00 2001 From: Jannik ZANDER Date: Tue, 17 Jul 2018 08:15:48 +0200 Subject: [PATCH] Replace lib with sources, keep dependency --- folder1/meson.build | 5 +++-- folder1_test/meson.build | 6 ++++-- folder2/meson.build | 6 ++++-- folder2_test/meson.build | 6 ++++-- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/folder1/meson.build b/folder1/meson.build index d6650d4..55eec19 100644 --- a/folder1/meson.build +++ b/folder1/meson.build @@ -1,3 +1,4 @@ +folder1_src = ['folder1.c'] folder1_inc = include_directories('.') -folder1_lib = static_library('folder1', 'folder1.c', include_directories : folder1_inc) -folder1_dep = declare_dependency(link_with: folder1_lib, include_directories : folder1_inc) +folder1_dep = declare_dependency(sources: folder1_src, + include_directories : folder1_inc) diff --git a/folder1_test/meson.build b/folder1_test/meson.build index 2dc1dd8..af74b29 100644 --- a/folder1_test/meson.build +++ b/folder1_test/meson.build @@ -1,2 +1,4 @@ -folder1_tst = executable('test1', 'folder1_test.cpp', dependencies : [gtest, folder1_dep]) -test('test 1', folder1_tst) +folder1_tst = executable('test1', + sources : ['folder1_test.cpp'], + dependencies : [gtest, folder1_dep]) +test('Test independent component', folder1_tst) diff --git a/folder2/meson.build b/folder2/meson.build index 08a2111..0167536 100644 --- a/folder2/meson.build +++ b/folder2/meson.build @@ -1,3 +1,5 @@ +folder2_src = ['folder2.c'] folder2_inc = include_directories('.') -folder2_lib = static_library('folder2', 'folder2.c', include_directories : folder2_inc, dependencies : folder1_dep) -folder2_dep = declare_dependency(link_with: folder2_lib, include_directories : folder2_inc) +folder2_dep = declare_dependency(sources: folder2_src, + include_directories : folder2_inc, + dependencies: folder1_dep) diff --git a/folder2_test/meson.build b/folder2_test/meson.build index 15dfb2f..5d09166 100644 --- a/folder2_test/meson.build +++ b/folder2_test/meson.build @@ -1,2 +1,4 @@ -folder2_tst = executable('test2', 'folder2_test.cpp', dependencies : [gtest, folder2_dep]) -test('test 2', folder2_tst) +folder2_tst = executable('test2', + sources : ['folder2_test.cpp'], + dependencies : [gtest, folder2_dep]) +test('Test component depending on another component', folder2_tst) -- 2.43.0