[PATCH] D125827: [cmake] Don't try creating an executable when detecting the linker
Louis Dionne via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 19 08:57:56 PDT 2022
ldionne added a comment.
In D125827#3520509 <https://reviews.llvm.org/D125827#3520509>, @smeenai wrote:
> I think this might potentially break cross-compilation on Windows. We're in a `NOT WIN32` block here, but that means you're not targeting Windows; you could still be targeting e.g. Linux but building on a Windows machine. I think `NUL` is the Windows equivalent, and you could have a `CMAKE_HOST_WIN32` block, but it'll depend on how CMake invokes an `execute_process` command. (I have a Windows machine handy and can experiment with that, if you'd like.) That being said
Hmm, I just tried it out on a Windows machine and it seems to work.
> I thought we forced out-of-tree builds (i.e. you needed to have a dedicated build directory and couldn't just run a CMake configuration from the source tree)? Having a separate build directory seems nicer in general, unless I'm misunderstanding what you meant.
We do force out of tree builds, however CMake can be invoked as `cmake -S llvm -B <path-to-build>`, in which case `a.out` will be generated in whatever directory you happen to be in.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D125827/new/
https://reviews.llvm.org/D125827
More information about the llvm-commits
mailing list