-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes issue #12959 compiler.links command for vala crashes
- Loading branch information
Showing
2 changed files
with
64 additions
and
0 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,24 @@ | ||
project('link-test', ['c', 'vala'], version: '0.1') | ||
|
||
valac = meson.get_compiler('vala') | ||
|
||
code = '''void main() { | ||
const double PI3 = 1.047197551196597746154214461093167628; | ||
var a = GLib.Math.cos (PI3); | ||
stdout.printf ("%f\n", a); }''' | ||
|
||
# test 1; code should link | ||
code_links = valac.links( | ||
code, | ||
args: '--Xcc=-lm', | ||
name: 'links with math library? == YES', | ||
) | ||
assert (code_links, 'Math library should link successfully.') | ||
|
||
# test 2; code should not link | ||
code_links = valac.links( | ||
code, | ||
args: '--Xcc=-lfake_library_90DFE450330A', | ||
name: 'links with fake library? == NO', | ||
) | ||
assert (not code_links, 'Fake library should not link successfully.') |