diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2020-11-23 23:03:35 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-24 00:03:35 +0200 |
commit | 0deab2ee9efc2ffe9e43f2787611e34656e6a304 (patch) | |
tree | fd60e29d4d91a6d566af3a0bfec1f8f6db0c2714 /test cases | |
parent | b53505a9dc2e82a5040d3427246935c50b63184b (diff) | |
download | meson-0deab2ee9efc2ffe9e43f2787611e34656e6a304.zip meson-0deab2ee9efc2ffe9e43f2787611e34656e6a304.tar.gz meson-0deab2ee9efc2ffe9e43f2787611e34656e6a304.tar.bz2 |
compiler: allow non-built internal dependencies as arguments
Allow methods on the compiler object to receive internal dependencies,
as long as they only specify compiler/linker arguments or other
dependencies that satisfy the same requirements.
This is useful if you're using internal dependencies to add special
"-D" flags such as -DNCURSES_WIDECHAR, -D_XOPEN_SOURCE_EXTENDED or
-DGLIB_STATIC_COMPILATION.
Diffstat (limited to 'test cases')
-rw-r--r-- | test cases/linuxlike/2 external library/meson.build | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test cases/linuxlike/2 external library/meson.build b/test cases/linuxlike/2 external library/meson.build index fbe661a..3188ebf 100644 --- a/test cases/linuxlike/2 external library/meson.build +++ b/test cases/linuxlike/2 external library/meson.build @@ -18,6 +18,12 @@ int main(void) { ''' assert(cc.links(linkcode, args : '-lz', name : 'Test link against zlib'), 'Linking test failed.') +d1 = declare_dependency(compile_args: '-DSOMETHING', link_args: '-lz') +assert(cc.links(linkcode, dependencies : d1, + name : 'Test link against zlib via declare_dependency'), 'Linking test failed.') +d2 = declare_dependency(dependencies: d1) +assert(cc.links(linkcode, dependencies : d2, + name : 'Test link against zlib via indirect declare_dependency'), 'Linking test failed.') assert(not cc.links(nolinkcode, name : 'Failing link'), 'Linking succeeded when it should have failed.') e = executable('zprog', 'prog.c', dependencies : zlib) |