]> git.zndr.dk Git - meson-test.git/commitdiff
Replace lib with sources, keep dependency
authorJannik ZANDER <jannikz@gmail.com>
Tue, 17 Jul 2018 06:15:48 +0000 (08:15 +0200)
committerJannik ZANDER <jannikz@gmail.com>
Tue, 17 Jul 2018 06:15:48 +0000 (08:15 +0200)
folder1/meson.build
folder1_test/meson.build
folder2/meson.build
folder2_test/meson.build

index d6650d462c3b942f30fd7e3ee7fbdf5f8832bc44..55eec19216f7f4e82ca401b8b7e564e13278ad61 100644 (file)
@@ -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)
index 2dc1dd87e02d06fd9c6d9232c4c9478d9204c6bb..af74b291a3f8ed45d0d16a81541d7c4ac925b721 100644 (file)
@@ -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)
index 08a2111967ad2f79618fe6f0c45314778064e6b7..0167536a3e4d32278f593fbbc68b50b610a108a3 100644 (file)
@@ -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)
index 15dfb2f1d2a56b847199e47695da9cf43c3b8264..5d09166bbefe613aa9e2cd369cd77d40253d5647 100644 (file)
@@ -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)