2

I'm not actually sure how to properly add arguments for clang. I am pretty sure the problem is down to incorrect syntax. For example, when adding "-fno-vectorize" (as seen here) in Properties > Command Line > Additional Options, the compiler tells me

1>clang-cl : warning : unknown argument ignored in clang-cl: '-fno-vectorize' [-Wunknown-argument]

So, the compiler sees the arguments, just doesn't parse them correctly.

For MSVC flags look like "/Qpar" (for example this one turns on auto-parallelization) and it works just fine.

Ivan Notaros
  • 21
  • 2
  • 3

1 Answers1

0

I believe clang-cl has a different argument syntax to clang. For most arguments, you can refer to MSVC documentation.

Often, this means replacing "-" by "/" and "=" by ":", like so, but sometimes the arguments are different altogether.

-std=c++17

by

/std:c++17

To tell clang and clang-cl appart, you can use the following:

elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
    if ("${CMAKE_CXX_SIMULATE_ID}" STREQUAL "MSVC")

As discussed here: How to differentiate between clang and clang-cl?

NGauthier
  • 885
  • 8
  • 17