[llvm-dev] Guidance on cross compiling LLVM with mingw-w64 and cmake
Tony Kelman via llvm-dev
llvm-dev at lists.llvm.org
Wed Feb 10 23:43:22 PST 2016
> The problem you are hitting is caused by setting CMAKE_SYSTEM_NAME.
> When you set that CMake sets a variable CMAKE_CROSS_COMPILING. That
> variable should only be set when your host OS doesn't match your target
> OS. Since LLVM needs to build host-capable tools there is some goop to
> call out and configure a new CMake build directory to target the host.
Right. My build OS doesn't match my target OS, my build is Linux or Cygwin,
and the target is Win32. So setting CMAKE_CROSS_COMPILING is correct.
It's the "goop" that needs some work to get back to parity with the
functionality that was working on autotools. Sorry I didn't try running
this configuration earlier on in the autotools-deprecation process.
The new CMake build directory for the native tools needs to not use the
same settings for compiler names as the parent cross-compile build.
Any ideas how to accomplish this? I'm happy to help test out patches
and dig into cmake docs as necessary to get this working. If this would
be more appropriate to work through in an issue than on the mailing
list, do say so.
More information about the llvm-dev