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

[question] Windows - Meson - Cross compiling from x86_64 to arm64 #13139

Closed
1 task done
szigetics opened this issue Feb 16, 2023 · 3 comments · Fixed by #13141
Closed
1 task done

[question] Windows - Meson - Cross compiling from x86_64 to arm64 #13139

szigetics opened this issue Feb 16, 2023 · 3 comments · Fixed by #13141
Milestone

Comments

@szigetics
Copy link

szigetics commented Feb 16, 2023

What is your question?

Hello!

Many recipes on the conan-center-index ( https://github.com/conan-io/conan-center-index ) have been updated to use Meson for building recipes.
I am having an issue, cross compiling from Windows x86_64 to Windows Arm64 using Meson. Here is the actual error that I see :

[2023-01-17T19:20:46.137Z] harfbuzz/5.3.1@jenkins-clt/stable: Meson configure cmd: meson setup --cross-file "C:\.conan\59d48f\1\build-debug\conan\conan_meson_cross.ini" "C:\.conan\59d48f\1\build-debug" "C:\.conan\59d48f\1\src" -Dprefix="C:\.conan\78bd72\1"
[2023-01-17T19:20:46.398Z] **********************************************************************
[2023-01-17T19:20:46.398Z] ** Visual Studio 2022 Developer Command Prompt v17.4.4
[2023-01-17T19:20:46.398Z] ** Copyright (c) 2022 Microsoft Corporation
[2023-01-17T19:20:46.398Z] **********************************************************************
[2023-01-17T19:20:48.305Z] [vcvarsall.bat] Environment initialized for: 'x64_arm64'
[2023-01-17T19:20:49.707Z] The Meson build system
[2023-01-17T19:20:49.707Z] Version: 0.64.1
[2023-01-17T19:20:49.707Z] Source dir: C:\.conan\59d48f\1\src
[2023-01-17T19:20:49.707Z] Build dir: C:\.conan\59d48f\1\build-debug
[2023-01-17T19:20:49.707Z] Build type: cross build
[2023-01-17T19:20:49.707Z] Project name: harfbuzz
[2023-01-17T19:20:49.707Z] Project version: 5.3.1
[2023-01-17T19:20:49.707Z] 
[2023-01-17T19:20:49.707Z] ..\src\meson.build:1:0: ERROR: 'c' compiler binary not defined in cross or native file

Based on these threads, it could be an issue with conan itself :
#10285
#4529

I have 2 questions :

  1. What is the current easiest and officially supported way for cross building using the Meson toolchain via conan?
  2. When will conan support cross building via Meson? Is there a specific Github issue that you would recommend following for status updates on this topic?

Thank you really much for your help in advance and keep up the good work! 🙂

Have you read the CONTRIBUTING guide?

  • I've read the CONTRIBUTING guide
@SpaceIm
Copy link
Contributor

SpaceIm commented Feb 16, 2023

Recipes migrated to MesonToolchain support cross-build, but looking at source code of MesonToolchain it is not robust to cross-build with Visual Studio if host profile doesn't explicitly set c & cpp keys of tools.build:compiler_executables config (or CC & CXX env vars in [buildenv]).

Add this to your host profile and it should work I think:

[conf]
tools.build:compiler_executables={"c": "cl", "cpp": "cl"}
[builenv]
CC=cl
CXX=cl

@szigetics
Copy link
Author

szigetics commented Feb 17, 2023

Recipes migrated to MesonToolchain support cross-build, but looking at source code of MesonToolchain it is not robust to cross-build with Visual Studio if host profile doesn't explicitly set c & cpp keys of tools.build:compiler_executables config (or CC & CXX env vars in [buildenv]).

Add this to your host profile and it should work I think:

[conf]
tools.build:compiler_executables={"c": "cl", "cpp": "cl"}
[builenv]
CC=cl
CXX=cl

Thank you @SpaceIm for the quick response! This worked like a charm!
(I had to fix the typo builenv => buildenv.)

@memsharded
Copy link
Member

Fixed in #13141 for Conan 1.61 and 2.0.7

@memsharded memsharded added this to the 1.61 milestone May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants