Merge pull request #3312 from MathieuDuponchelle/alwaysfallback
new wrap-mode: forcefallbackpull/3361/merge
commit
d6e71d0c56
11 changed files with 76 additions and 6 deletions
@ -0,0 +1,3 @@ |
||||
A new wrap mode was added, `--wrap-mode=forcefallback`. When this is set, |
||||
dependencies for which a fallback was provided will always use it, even |
||||
if an external dependency exists and satisfies the version requirements. |
@ -0,0 +1,8 @@ |
||||
project('mainproj', 'c', |
||||
default_options : ['wrap_mode=forcefallback']) |
||||
|
||||
zlib_dep = dependency('zlib', fallback: ['notzlib', 'zlib_dep']) |
||||
|
||||
test_not_zlib = executable('test_not_zlib', ['test_not_zlib.c'], dependencies: [zlib_dep]) |
||||
|
||||
test('test_not_zlib', test_not_zlib) |
@ -0,0 +1,7 @@ |
||||
project('notzlib', 'c') |
||||
|
||||
notzlib_sources = ['notzlib.c'] |
||||
|
||||
notzlib = library('notzlib', notzlib_sources) |
||||
|
||||
zlib_dep = declare_dependency(link_with: notzlib, include_directories: include_directories(['.'])) |
@ -0,0 +1,6 @@ |
||||
#include "notzlib.h" |
||||
|
||||
int not_a_zlib_function (void) |
||||
{ |
||||
return 42; |
||||
} |
@ -0,0 +1,18 @@ |
||||
#pragma once |
||||
|
||||
#if defined _WIN32 || defined __CYGWIN__ |
||||
#if defined BUILDING_DLL |
||||
#define DLL_PUBLIC __declspec(dllexport) |
||||
#else |
||||
#define DLL_PUBLIC __declspec(dllimport) |
||||
#endif |
||||
#else |
||||
#if defined __GNUC__ |
||||
#define DLL_PUBLIC __attribute__ ((visibility("default"))) |
||||
#else |
||||
#pragma message ("Compiler does not support symbol visibility.") |
||||
#define DLL_PUBLIC |
||||
#endif |
||||
#endif |
||||
|
||||
int DLL_PUBLIC not_a_zlib_function (void); |
@ -0,0 +1,8 @@ |
||||
#include <notzlib.h> |
||||
|
||||
int main (int ac, char **av) |
||||
{ |
||||
if (not_a_zlib_function () != 42) |
||||
return 1; |
||||
return 0; |
||||
} |
Loading…
Reference in new issue