blob: a3bcf1c24a9186516616909996535d47abc91129 [file] [log] [blame]
Shoaib Meenaic84211b2017-12-15 01:05:48 +00001# macOS paths usually start with /Users/*. Unfortunately, clang-cl interprets
2# paths starting with /U as macro undefines, so we need to put a -- before the
3# input file path to force it to be treated as a path. CMake's compilation rules
4# should be tweaked accordingly, but until that's done, and to support older
5# CMake versions, overriding compilation rules works well enough. This file will
6# be included by cmake after the default compilation rules have already been set
7# up, so we can just modify them instead of duplicating them entirely.
8string(REPLACE "-c <SOURCE>" "-c -- <SOURCE>" CMAKE_C_COMPILE_OBJECT "${CMAKE_C_COMPILE_OBJECT}")
9string(REPLACE "-c <SOURCE>" "-c -- <SOURCE>" CMAKE_CXX_COMPILE_OBJECT "${CMAKE_CXX_COMPILE_OBJECT}")