c++cmakeclang-cl

cmake detects clang-cl as clang


I built boringssl with cmake and msvc Then I tried to build with clang-cl so I used -T"LLVM-vs2014" in vmake arguments

Clang-cl uses cl arguments however cmake used gcc style arguments without adding -Xclang


Solution

  • The proper way to handle this case is checking for

    (CMAKE_CXX_COMPILER_ID STREQUAL Clang AND "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC"))