]> git.zndr.dk Git - meson-test.git/commitdiff
Glob subdirs (problem w dependencies) master
authorJannik ZANDER <jannikz@gmail.com>
Tue, 17 Jul 2018 18:18:05 +0000 (20:18 +0200)
committerJannik ZANDER <jannikz@gmail.com>
Tue, 17 Jul 2018 18:18:05 +0000 (20:18 +0200)
folder1/meson.build
folder2/meson.build
meson.build

index 55eec19216f7f4e82ca401b8b7e564e13278ad61..b3f16d58dfe1e2040638098f44524e896c0f8822 100644 (file)
@@ -1,4 +1,4 @@
-folder1_src = ['folder1.c']
+folder1_src = files(['folder1.c'])
 folder1_inc = include_directories('.')
 folder1_dep = declare_dependency(sources: folder1_src, 
                                  include_directories : folder1_inc)
index 223a3c84b774bf8376dc7b0c9c294ebe6496ef70..2358cdbcb7cdfff644a3378fcd6c11a33ef4e833 100644 (file)
@@ -1,4 +1,4 @@
-folder2_src = ['folder2.c']
+folder2_src = files(['folder2.c'])
 folder2_inc = include_directories('.')
 folder2_dep = declare_dependency(sources: folder2_src,
                                  include_directories : folder2_inc,
index dd5e46dd157c60f0381daa0cc4cadda1f128cc7c..b3cb05034374d8b1402b1e67efdbf712474d354a 100644 (file)
@@ -1,11 +1,9 @@
 project('meson_test','cpp', 'c')
 
 gtest = dependency('gtest', main : true, required : false)
-
 if not gtest.found()
   gtest_sub = subproject('gtest')
-  gtest_src = [gtest_sub.get_variable('gtest_libsources'), 
-               gtest_sub.get_variable('gtest_mainsources')]
+  gtest_src = [gtest_sub.get_variable('gtest_libsources'), gtest_sub.get_variable('gtest_mainsources')]
   gtest_inc = gtest_sub.get_variable('gtest_incdir')
   gtest_lib = static_library('gtest', sources: gtest_src,
                                       include_directories: gtest_inc)
@@ -14,8 +12,13 @@ if not gtest.found()
                              dependencies: dependency('threads'))
 endif
 
-subdir('folder1')
-subdir('folder1_test')
-subdir('folder2')
-subdir('folder2_test')
+py3 = import('python3').find_python()
+ret = run_command(py3, '-c', 'import glob\ndirs = glob.glob("**/meson.build")\nfor d in sorted(dirs): print(d[:-12])')
+dirs = []
+if ret.returncode() == 0
+  dirs += ret.stdout().split()
+endif
 
+foreach d : dirs
+  subdir(d)
+endforeach