OSDN Git Service

[cmake] Fix clang-cl cross-compilation on macOS
authorShoaib Meenai <smeenai@fb.com>
Fri, 15 Dec 2017 01:05:48 +0000 (01:05 +0000)
committerShoaib Meenai <smeenai@fb.com>
Fri, 15 Dec 2017 01:05:48 +0000 (01:05 +0000)
commit9d3546dc524277cf50ecfaca6e0be9ccd1a02b80
tree9a4a9c058e63ce0f68634511d4a005da38cd2e0a
parent2955f15b7fc8eeed3fe7c4b3e636c185189379dc
[cmake] Fix clang-cl cross-compilation on macOS

macOS paths usually start with /Users, which clang-cl interprets as a
macro undefine, leading to pretty much everything failing to compile.

CMake should be taught to put a -- in its compilation rules for clang-cl
(and I've been meaning to submit that upstream for a while). In the
meantime, however, and to support older CMake versions, we can just
create a custom make rules override to fix the compilation rules.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320785 91177308-0d34-0410-b5e6-96231b3b80d8
cmake/platforms/ClangClCMakeCompileRules.cmake [new file with mode: 0644]
cmake/platforms/WinMsvc.cmake