The default value of required is true for dependencies.

pull/15/head
Jussi Pakkanen 12 years ago
parent 0d2f34654c
commit 852b774e2e
  1. 4
      dependencies.py
  2. 4
      test cases/frameworks/1 boost/meson.build
  3. 2
      test cases/frameworks/2 gtest/meson.build
  4. 4
      test cases/frameworks/3 gmock/meson.build
  5. 2
      test cases/frameworks/4 qt5/meson.build
  6. 2
      test cases/frameworks/5 protocol buffers/meson.build
  7. 6
      test cases/linuxlike/1 pkg-config/meson.build
  8. 4
      test cases/objc/2 nsstring/meson.build

@ -155,7 +155,9 @@ class ExternalLibrary(Dependency):
return []
def find_external_dependency(name, kwargs):
required = kwargs.get('required', False)
required = kwargs.get('required', True)
if not isinstance(required, bool):
raise DependencyException('Keyword "required" must be a boolean.')
if name in packages:
dep = packages[name](kwargs)
if required and not dep.found():

@ -4,8 +4,8 @@ project('boosttest', 'cxx')
# within one project. The need to be independent of each other.
# Use one without a library dependency and one with it.
nolinkdep = find_dep('boost', modules: 'utility', required : true)
linkdep = find_dep('boost', modules : 'thread', required : true)
nolinkdep = find_dep('boost', modules: 'utility')
linkdep = find_dep('boost', modules : 'thread')
nolinkexe = executable('nolinkedexe', 'nolinkexe.cc', deps : nolinkdep)
linkexe = executable('linkedexe', 'linkexe.cc', deps : linkdep)

@ -1,6 +1,6 @@
project('gtest', 'cxx')
gtest = find_dep('gtest', required : true)
gtest = find_dep('gtest')
e = executable('testprog', 'test.cc', deps : gtest)
add_test('gtest test', e)

@ -3,8 +3,8 @@ project('gmock test', 'cxx')
# Using gmock without gtest is a pain so just
# don't support that then.
gtest = find_dep('gtest', required : true)
gmock = find_dep('gmock', required : true)
gtest = find_dep('gtest')
gmock = find_dep('gmock')
e = executable('gmocktest', 'gmocktest.cc', deps : [gtest, gmock])
add_test('gmock test', e)

@ -1,6 +1,6 @@
project('qt5 build test', 'cxx')
qt5dep = find_dep('qt5', modules : 'Widgets', required : true)
qt5dep = find_dep('qt5', modules : 'Widgets')
q5exe = executable('qt5test',
sources : ['main.cpp', 'mainWindow.cpp'], # Sources that don't need preprocessing.

@ -1,7 +1,7 @@
project('protocol buffer test', 'cxx')
protoc = find_program('protoc', required : true)
dep = find_dep('protobuf', required : true)
dep = find_dep('protobuf')
gen = generator(protoc, \
outputs : ['@BASENAME@.pb.cc', '@BASENAME@.pb.h'],

@ -2,7 +2,11 @@ project('external dependency', 'c')
# Zlib is probably on all dev machines.
dep = find_dep('zlib', required : true)
dep = find_dep('zlib')
exe = executable('zlibprog', 'prog.c', deps : dep)
add_test('zlibtest', exe)
# Try to find a nonexistant library to ensure requires:false works.
dep = find_dep('nvakuhrabnsdfasdf', required : false)

@ -1,9 +1,9 @@
project('nsstring', 'objc')
if host.name() == 'darwin'
dep = find_dep('appleframeworks', modules : 'foundation', required : true)
dep = find_dep('appleframeworks', modules : 'foundation')
else
dep = find_dep('gnustep', required : true)
dep = find_dep('gnustep')
endif
exe = executable('stringprog', 'stringprog.m', deps : dep)
add_test('stringtest', exe)

Loading…
Cancel
Save