Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross-compiling 'test cases/rust/5 polyglot static' and others #5175

Open
elmarco opened this issue Mar 29, 2019 · 1 comment
Open

Cross-compiling 'test cases/rust/5 polyglot static' and others #5175

elmarco opened this issue Mar 29, 2019 · 1 comment

Comments

@elmarco
Copy link
Contributor

elmarco commented Mar 29, 2019

Hi,

I am looking at cross-compiling 'test cases/rust/5 polyglot static' and other examples.

On f29 (mingw64-configure && ninja), with a capable rust toolchain (x86_64-pc-windows-gnu target) and the https://bugzilla.redhat.com/show_bug.cgi?id=1694165 fix (using gnu instead of msvc, I can cross-compile with the following fix applied:

diff --git a/test cases/rust/5 polyglot static/meson.build b/test cases/rust/5 polyglot static/meson.build
index 1441367d..632972ec 100644
--- a/test cases/rust/5 polyglot static/meson.build     
+++ b/test cases/rust/5 polyglot static/meson.build     
@@ -5,12 +5,14 @@ deps = [
   dependency('threads'),
 ]
 
-extra_winlibs = meson.get_compiler('c').get_id() == 'msvc' ? ['userenv.lib', 'ws2_32.lib'] : []
+if host_machine.system() == 'windows'
+  deps += [meson.get_compiler('c').find_library('userenv')]
+  deps += [meson.get_compiler('c').find_library('ws2_32')]
+endif
 
 l = static_library('stuff', 'stuff.rs', rust_crate_type : 'staticlib', install : true)
 e = executable('prog', 'prog.c',
                dependencies: deps,
                link_with : l,
-               link_args: extra_winlibs,
                install : true)
 test('polyglottest', e)

Is that a good fix? I can write a patch and test the rest of the testcases. Please advise.

@araspik
Copy link

araspik commented Aug 8, 2019

if host_machine.system() == 'windows' and meson.get_compiler('c').get_id() == 'msvc'

? Seems better seeing that the original seemed to be specifically about MSVC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants