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

crosscompile xkbcommon on linux for windows (2/2) #306

Open
awarnke opened this issue Oct 31, 2022 · 5 comments
Open

crosscompile xkbcommon on linux for windows (2/2) #306

awarnke opened this issue Oct 31, 2022 · 5 comments
Labels
enhancement Indicates new feature requests good first issue Indicates a good issue for first-time contributors help wanted Indicates that a maintainer wants help on an issue or pull request os: Windows Windows-specific

Comments

@awarnke
Copy link

awarnke commented Oct 31, 2022

Hello,

crosscompiling xkbcommon on linux (OpenSuse 15.4) for windows works, when applying some changes:

  1. For the #ifdef _MSC_VER issue, see crosscompile xkbcommon on linux for windows (1/2) #305

  2. There is another issue with the tests:

Even if I could compile these, they would not run on the build-host (linux) since the target-system is windows.

If I remove the lines 525 up to the line # Documentation from the meson.build. i can compile and install the lib.
So: I removed the test cases.

It would be nice, if i could simply turn these off by a meson switch.?

PS: Some infos on setting up cross-compile of libxkbcommon for win are documented here:
https://github.com/awarnke/crystal-facet-uml/tree/master/build/win

Kind Regards
Andreas

@whot
Copy link
Contributor

whot commented Nov 14, 2022

It would be nice, if i could simply turn these off by a meson switch.?

I reckon we'll eventually end up with enable-tests and run-tests meson options :) Because that happens with all other projects that have this requirement - on some systems building the tests isn't needed/wanted (usually on constrained systems) and on others building is wanted but running them isn't.

Do feel free to submit a PR though :)

@awarnke
Copy link
Author

awarnke commented Nov 14, 2022

Thank you for the invitation to state a PR. Right now I have the feeling of having already too many projects. Lets see if I find the time …

@bluetech
Copy link
Member

Hmm is the tests don't build when cross-compiling then that should be fixed I think? Compiling tests is no different from compiling the lib.

What are the errors compiling the tests?

they would not run on the build-host (linux) since the target-system is windows.

This is the reality in every cross-compiling scenario. The solution is to just not run the tests :) Or am I missing something?

@awarnke
Copy link
Author

awarnke commented Apr 13, 2023

;-) The point is that there is no switch to turn the test off. (Half a year ago)
Or I have not found it.

I had to change the meson.build script for that. Which is fine unless I intend to regularly pull updates and have to update the build scrip every time.

Andreas

@awarnke
Copy link
Author

awarnke commented Apr 14, 2023

Example from other libraries:

meson setup . builddir --cross-file ../../cross_file.txt -Dprefix=${PREFIX} \
-Dwin32-backend=true -Dx11-backend=false -Dwayland-backend=false

see
https://github.com/awarnke/crystal-facet-uml/blob/master/build/win/3rd_party/5_compile_graphics_libraries.sh#L142

@wismill wismill added os: Windows Windows-specific enhancement Indicates new feature requests help wanted Indicates that a maintainer wants help on an issue or pull request good first issue Indicates a good issue for first-time contributors labels May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Indicates new feature requests good first issue Indicates a good issue for first-time contributors help wanted Indicates that a maintainer wants help on an issue or pull request os: Windows Windows-specific
Projects
None yet
Development

No branches or pull requests

4 participants