]> git.zndr.dk Git - meson-test.git/commitdiff
Static gtest lib
authorJannik ZANDER <jannikz@gmail.com>
Tue, 17 Jul 2018 11:13:30 +0000 (13:13 +0200)
committerJannik ZANDER <jannikz@gmail.com>
Tue, 17 Jul 2018 11:13:47 +0000 (13:13 +0200)
folder1_test/meson.build
folder2/meson.build
folder2_test/meson.build
meson.build

index af74b291a3f8ed45d0d16a81541d7c4ac925b721..f978e4e1f455fb1a957a492baf9e52edc4dd23dc 100644 (file)
@@ -1,4 +1,4 @@
-folder1_tst = executable('test1', 
-                         sources : ['folder1_test.cpp'], 
+folder1_tst = executable('folder1_test',
+                         sources : ['folder1_test.cpp'],
                          dependencies : [gtest, folder1_dep])
 test('Test independent component', folder1_tst)
index 0167536a3e4d32278f593fbbc68b50b610a108a3..223a3c84b774bf8376dc7b0c9c294ebe6496ef70 100644 (file)
@@ -1,5 +1,5 @@
 folder2_src = ['folder2.c']
 folder2_inc = include_directories('.')
-folder2_dep = declare_dependency(sources: folder2_src, 
-                                 include_directories : folder2_inc, 
+folder2_dep = declare_dependency(sources: folder2_src,
+                                 include_directories : folder2_inc,
                                  dependencies: folder1_dep)
index 5d09166bbefe613aa9e2cd369cd77d40253d5647..48076ad53e3b01f749f22cf700c363659f10e5ac 100644 (file)
@@ -1,4 +1,4 @@
-folder2_tst = executable('test2', 
-                         sources : ['folder2_test.cpp'], 
+folder2_tst = executable('folder2_test',
+                         sources : ['folder2_test.cpp'],
                          dependencies : [gtest, folder2_dep])
 test('Test component depending on another component', folder2_tst)
index 5d2eae0e51f680c4a98ccaa4a773c253d1da8252..f2c1c5b5495288639824507acd7f0827ded4272c 100644 (file)
@@ -1,9 +1,20 @@
 project('meson_test','cpp', 'c')
 
-
 gtest_sub = subproject('gtest')
-gtest = gtest_sub.get_variable('gtest_main_dep')
 
+gtest_inc = gtest_sub.get_variable('gtest_incdir')
+gtest_src = [gtest_sub.get_variable('gtest_libsources'), 
+             gtest_sub.get_variable('gtest_mainsources')]
+#gtest_dep = [gtest_sub.get_variable('gtest_main_dep'),
+#             dependency('threads')]
+
+gtest_lib = static_library('gtest_lib', sources: gtest_src,
+                                        include_directories: gtest_inc)
+#                                        dependencies : gtest_dep) 
+
+gtest = declare_dependency(include_directories : gtest_inc,
+                           link_with : gtest_lib,
+                           dependencies: dependency('threads'))
 
 subproject('gtest')
 subdir('folder1')