aboutsummaryrefslogtreecommitdiff
path: root/test cases/cmake/26 dependency fallback/meson.build
blob: 871d70c9f8ea73c7a4b5b684f5e55effb75e5448 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
project('cmakeSubTest', ['c', 'cpp'])

# Fallback to a CMake subproject
sub_dep = dependency('cmModLib++')
exe1 = executable('main', ['main.cpp'], dependencies: [sub_dep])
test('test1', exe1)

# Subproject contains both meson.build and CMakeLists.txt. It should default
# to meson but wrap force cmake.
subproject('force_cmake')

testcase expect_error('Wrap method \'notfound\' is not supported, must be one of: meson, cmake, cargo')
  subproject('broken_method')
endtestcase

# With method=meson we can't use cmake.subproject()
cmake = import('cmake')
testcase expect_error('Wrap method is \'meson\' but we are trying to configure it with cmake')
  cmake.subproject('meson_method')
endtestcase

# cmake.subproject() force cmake method even if meson.build exists.
testcase expect_error('Subproject exists but has no CMakeLists.txt file.')
  cmake.subproject('meson_subp')
endtestcase

# Without specifying the method it defaults to meson even if CMakeLists.txt exists.
testcase expect_error('Subproject exists but has no meson.build file.')
  subproject('cmake_subp')
endtestcase