12f20c5abSAndrew Jefferygtest_dep = dependency('gtest', main: true, disabler: true, required: false) 22f20c5abSAndrew Jefferygmock_dep = dependency('gmock', disabler: true, required: false) 32f20c5abSAndrew Jefferyif not gtest_dep.found() or not gmock_dep.found() 42f20c5abSAndrew Jeffery gtest_proj = import('cmake').subproject('googletest', required: false) 52f20c5abSAndrew Jeffery if gtest_proj.found() 62f20c5abSAndrew Jeffery gtest_dep = declare_dependency( 72f20c5abSAndrew Jeffery dependencies: [ 82f20c5abSAndrew Jeffery dependency('threads'), 92f20c5abSAndrew Jeffery gtest_proj.dependency('gtest'), 102f20c5abSAndrew Jeffery gtest_proj.dependency('gtest_main'), 11*ab8b045eSAndrew Jeffery ], 122f20c5abSAndrew Jeffery ) 132f20c5abSAndrew Jeffery gmock_dep = gtest_proj.dependency('gmock') 142f20c5abSAndrew Jeffery else 152f20c5abSAndrew Jeffery assert( 165bc307fbSPatrick Williams not get_option('tests').allowed(), 17*ab8b045eSAndrew Jeffery 'Googletest is required if tests are enabled', 182f20c5abSAndrew Jeffery ) 192f20c5abSAndrew Jeffery endif 202f20c5abSAndrew Jefferyendif 21feb19ef0SBrad Bishop 2216966b55SEd Tanousut_deps_list = [ 2316966b55SEd Tanous gtest_dep, 2416966b55SEd Tanous] 2516966b55SEd Tanous 2616966b55SEd Tanousut_deps_list += default_deps 2716966b55SEd Tanous 28d3204145SLei YUtest( 29d3204145SLei YU 'test_utils', 30d3204145SLei YU executable( 31d3204145SLei YU 'test_utils', 32d3204145SLei YU 'test_Utils.cpp', 33d3204145SLei YU '../src/Utils.cpp', 3416966b55SEd Tanous dependencies: ut_deps_list, 35d3204145SLei YU implicit_include_directories: false, 36e73bd0a1SAndrew Jeffery include_directories: '../src', 37*ab8b045eSAndrew Jeffery ), 38d3204145SLei YU) 39