-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)
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)
-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)
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')