diff options
| author | Charles Brunet <charles.brunet@optelgroup.com> | 2023-12-13 16:02:11 -0500 |
|---|---|---|
| committer | Dylan Baker <dylan@pnwbakers.com> | 2024-09-06 10:56:44 -0700 |
| commit | ce1602c1ee573f98ab409bcc645d9c7a07925836 (patch) | |
| tree | bcd69f82bdff413119ccbc80544dfeef37a8eb38 /test cases/common | |
| parent | 0fc363021e5c2e79a68fb33e60b72b8ffd353875 (diff) | |
| download | meson-ce1602c1ee573f98ab409bcc645d9c7a07925836.tar.gz | |
alias_target with both_libs builds both
Diffstat (limited to 'test cases/common')
| -rw-r--r-- | test cases/common/178 bothlibraries/meson.build | 1 | ||||
| -rw-r--r-- | test cases/common/273 both libraries/meson.build | 28 |
2 files changed, 28 insertions, 1 deletions
diff --git a/test cases/common/178 bothlibraries/meson.build b/test cases/common/178 bothlibraries/meson.build index 62f2061f8..654d94e66 100644 --- a/test cases/common/178 bothlibraries/meson.build +++ b/test cases/common/178 bothlibraries/meson.build @@ -2,6 +2,7 @@ project('both libraries linking test', 'c', 'cpp') both_libs = both_libraries('mylib', 'libfile.c') dep = declare_dependency(link_with: both_libs) +alias_target('alias', both_libs) exe_shared = executable('prog-shared', 'main.c', link_with : both_libs.get_shared_lib()) exe_static = executable('prog-static', 'main.c', c_args : ['-DSTATIC_COMPILATION'], diff --git a/test cases/common/273 both libraries/meson.build b/test cases/common/273 both libraries/meson.build index de7668ce4..00da1c8e6 100644 --- a/test cases/common/273 both libraries/meson.build +++ b/test cases/common/273 both libraries/meson.build @@ -77,11 +77,37 @@ test('test both libs', main) if get_option('default_library') == 'both' and get_option('default_both_libraries') == 'auto' # With those options, even if the both_libraries defaults to 'shared', # 'static' version is used when linking to the static part of another both_libraries. + + if get_option('use_dep') + main_static_deps = [with_library_dep.as_static(recursive: true)] + main_static_links = [] + else + main_static_deps = [] + main_static_links = [with_library.get_static_lib()] + endif main_static = executable( 'main_static', files('src/main.c'), c_args: [f'-DEXPECTED=0'], - link_with: with_library.get_static_lib(), + link_with: main_static_links, + dependencies: main_static_deps, ) test('test static', main_static) + + + if get_option('use_dep') + main_shared_deps = [with_library_dep.as_shared(recursive: true)] + main_shared_links = [] + else + main_shared_deps = [] + main_shared_links = [with_library.get_shared_lib()] + endif + main_shared = executable( + 'main_shared', + files('src/main.c'), + c_args: [f'-DEXPECTED=2'], + link_with: main_shared_links, + dependencies: main_shared_deps, + ) + test('test shared', main_shared) endif |
