I try to get clang 5.0.0 working for Visual Studio 2015, because I need OpenMP 3.0 features. I installed the clang compiler (not the vs2015 version which does not have any o
It is really a bit tricky and the cmake autodetection doesn't seem to work very well. What helped is
OpenMP_CXX_FLAGS="-Xclang -fopenmp"
OpenMP_C_FLAGS="-Xclang -fopenmp"
And making sure that libomp.lib
is in the link libraries.
-Xclang
tells the clang binary, that the following options are in clang format and not in MSVC format and -fopenmp is then just the usual OpenMP flag. Setting it any other way did not work, though.
The general pattern is: -Xclang -clangFlag1 -Xclang -clangFlag2...
. Namely each Clang Style flag requires its own -Xclang
.