forked from mesonbuild/meson
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
interpreter: when overriding a dependency make its name match
Otherwise internal dependencies have auto-generated names that are not human readable. Instead, use the name that the dependency overrides. For example: ```meson meson.override_dependency('zlib', declare_dependency()) dep_zlib = dependency('zlib') assert(dep_zlib.name() == 'zlib') ``` Fixes: mesonbuild#12967
- Loading branch information
Showing
7 changed files
with
79 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
test cases/common/183 partial dependency/external_dependency/header_only.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* Copyright © 2024 Intel Corporation | ||
*/ | ||
|
||
#include <zlib.h> | ||
|
||
int main(void) { return 0; } |
12 changes: 12 additions & 0 deletions
12
test cases/common/183 partial dependency/external_dependency/link.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* Copyright © 2024 Intel Corporation | ||
*/ | ||
|
||
#include <zlib.h> | ||
#include <string.h> | ||
|
||
int main(void) { | ||
const char * zver = zlibVersion(); | ||
return strcmp(zver, ZLIB_VERSION); | ||
} |
17 changes: 17 additions & 0 deletions
17
test cases/common/183 partial dependency/external_dependency/meson.build
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# Copyright © 2024 Intel Corporation | ||
|
||
# TODO: don't use compile whenever we get includes and compile args separated | ||
dep_zlib_sub = dep_zlib.partial_dependency(compile_args : true, includes : true) | ||
|
||
executable( | ||
'zlib header only test', | ||
'header_only.c', | ||
dependencies : dep_zlib_sub, | ||
) | ||
|
||
executable( | ||
'zlib link test', | ||
'link.c', | ||
dependencies : [dep_zlib_sub, dep_zlib], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters