]> git.zndr.dk Git - meson-test.git/commitdiff
Static lib dependencies
authorJannik ZANDER <jannikz@gmail.com>
Mon, 16 Jul 2018 16:27:43 +0000 (18:27 +0200)
committerJannik ZANDER <jannikz@gmail.com>
Mon, 16 Jul 2018 16:27:43 +0000 (18:27 +0200)
folder1/meson.build
folder2/meson.build
meson.build

index 77cc3d99057b7a335e0a1ca59a74f1a9852fc671..cd5280e1369eec09bc21d65674b0f4887cf24b85 100644 (file)
@@ -1,6 +1,5 @@
-# Test 1
-folder1 = 'folder1.c'
-folder1_test = executable('test 1', 
-                          'folder1_test.cpp', folder1,
-                          dependencies : gtest)
-test('test 1', folder1_test)
+folder1_inc = include_directories('')
+folder1_lib = static_library('folder1', 'folder1.c')
+folder1_dep = declare_dependency(link_with : folder1_lib, include_directories : folder1_inc)
+folder1_tst = executable('test1', 'folder1_test.cpp', dependencies : [gtest, folder1_dep])
+test('test 1', folder1_tst)
index 9624265ece0f81a11b1186b0b00228afd4282262..fb87cd22faa5d758e3561c18b39085e0f8ae98b9 100644 (file)
@@ -1,8 +1,5 @@
-
-# Test 2
-folder1 = '../folder1/folder1.c'
-folder2 = 'folder2.c'
-folder2_test = executable('test 2',
-                          'folder2_test.cpp', folder1, folder2,
-                          dependencies : gtest)
-test('test 2', folder2_test)
+folder2_inc = include_directories('')
+folder2_lib = static_library('folder2', 'folder2.c')
+folder2_dep = declare_dependency(link_with : folder2_lib, include_directories : folder2_inc, dependencies : folder1_dep)
+folder2_tst = executable('test2', 'folder2_test.cpp', dependencies : [gtest, folder2_dep])
+test('test 2', folder2_tst)
index 0fdd14dc94bcb711f906cccbb6ced8c55f42441d..1ca818624e0a79719d8396c595435b3ac5129ccc 100644 (file)
@@ -1,10 +1,5 @@
 project('meson_test','cpp', 'c')
-
 gtest = dependency('gtest', main : true, required : false)
-
-# Test 1
 subdir('folder1')
-
-# Test 2
 subdir('folder2')