[PATCH] D125827: [cmake] Don't try creating an executable when detecting the linker

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 17 12:49:23 PDT 2022


smeenai added a comment.

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

> This is extremely annoying because it creates a a.out file at the root of the monorepo when running CMake configuration from the root.

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.


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