[all-commits] [llvm/llvm-project] cd1b95: [cmake] Fix native tooling when cross-compiling on...

Shoaib Meenai via All-commits all-commits at lists.llvm.org
Fri Aug 20 10:05:31 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cd1b95014121442b79ee91f2002cc82c70b17639
      https://github.com/llvm/llvm-project/commit/cd1b95014121442b79ee91f2002cc82c70b17639
  Author: Shoaib Meenai <smeenai at fb.com>
  Date:   2021-08-20 (Fri, 20 Aug 2021)

  Changed paths:
    M llvm/cmake/config-ix.cmake

  Log Message:
  -----------
  [cmake] Fix native tooling when cross-compiling on Linux

At least as of CMake 3.20.3, the CMake platform file for Linux doesn't
define the file type prefix and suffix variables, relying on them being
implicitly empty when they're unset. If we're cross-compiling targeting
Windows on a Linux machine, the values of these prefixes and suffixes
populated by the Windows platform file will still be set after including
the Linux platform file, so we'll incorrectly assume the ".exe" suffix
for the host machine. Explicitly unset the variables before including
the platform file, to prevent any previous values from leaking. Thanks
@beanz for suggesting the fix.

Reviewed By: beanz

Differential Revision: https://reviews.llvm.org/D108473




More information about the All-commits mailing list