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.
compilers: Pass all options to links/compiles
The `compiler.links()` and `compiler.compiles()` functions did not take into account all arguments which might be added to a real link or real compile job, specifically it was failing to add many of the options which are added as a result of language level options such as `b_coverage` or `b_sanitize`. This commit fixes that by constructing the args list for these functions using the same methods as a real compile/link job. A new unittest has been added to check that this is functioning correctly. Fixes: mesonbuild#13610
- Loading branch information
Showing
3 changed files
with
31 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# https://github.com/mesonbuild/meson/issues/13610 | ||
|
||
project('279 compiler.links args', 'c') | ||
cc = meson.get_compiler('c') | ||
|
||
gcov_str = ''' | ||
#include <gcov.h> | ||
int main(void) { | ||
__gcov_dump(); | ||
return 0; | ||
} | ||
''' | ||
|
||
if cc.links(gcov_str) | ||
message('successful link') | ||
else | ||
error('does not link') | ||
endif |
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