Closed HappySeaFox closed 10 months ago
CMakeCache.txt
Seems to be an error in Visual Studio's cmake support. Building from directly from CMake works, and there's no quotes around the arguments in the CMake cache. The error only happens when compiling the generated solution file in VS. Building from VS throws this error:
clang-cl : warning : unknown argument ignored in clang-cl: '-Xclang -fopenmp' [-Wunknown-argument]
VS seems to incorrectly see -Xclang -fopenmp
as a single argument and puts both in a single set of quotes which causes the issue (shows up in the Additional Options as %(AdditionalOptions) "-Xclang -fopenmp"
). Removing the quotes fixes the error.
I see. What's your CMake version? Maybe it's a bug in the CMake VS generator.
Upon further testing, openMP wasn't actually getting enabled when compiling the project. Even though the arguments in OpenMP_C_FLAGS are correct (-Xclang -fopenmp), CMake tries to encapsulate both arguments in a single set of quotes which makes it invalid. Using the alternative syntax for passing normal clang arguments to clang-cl works though (/clang:-fopenmp). This seems to function correctly in my testing:
Originally posted by @Error-mdl in https://github.com/HappySeaFox/sail/issues/203#issuecomment-1856526290