Teach KDECompilerSettings about clang-cl, a mode of Clang compiler that simulates MSVC.

Review Request #128779 - Created Aug. 27, 2016 and updated

Gleb Popov
extracmakemodules, kdewin

By simply using if(CMAKE_COMPILER_ID STREQUAL "Clang") check is not enough for clang-cl, as it turns on various '-style' flags and omits MSVC's '/style' flags.

With this patch i managed to compile much of KF5 up to konversation and kate.

Known problems: -std=gnu++98 flag is still appended, but i wasn't able to figure out why.



  • 0
  • 2
  • 2
  • 4
Description From Last Updated
Gleb Popov
Kevin Funk
Kevin Funk
Gleb Popov
Gleb Popov
Ben Cooksley
Anthony Fieroni
Gleb Popov
Review request changed

Change Summary:

Hopefully fixed broken tests.

The problem was with if(CLANG_AS_MSVC) expression. It was treated as string constant by CMake, thus evaluating to true.
I've tested this on FreeBSD, and tests now work.


Revision 3 (+25 -18)

Show changes

Albert Astals Cid

Patch doesn't apply anymore

  1. Is there any interest in this?

  2. To be honest I don't even understand what it does from the description :D

    What does "simulates MSVC" mean? It compiles windows binaries from linux?

  3. When clang.exe is invoked as clang-cl.exe, it acts just like Microsoft cl.exe, uses MSVC headers and native Windows runtime.

  4. And provides a cl.exe-like command line interface, rather than gcc-like.