CheckSymbolExists: document that it fails with intrinsic functions
Using CMake 3.8, Visual Studio 2015 and 2017 the following checks fail:
check_symbol_exists (__cpuid intrin.h HAVE___CPUID)
check_symbol_exists (__cpuidex intrin.h HAVE___CPUIDEX)
The reason for this is that cl
unconditionally uses the /Od
flag during the checks causing linker errors such as error LNK2019: unresolved external symbol ___cpuid referenced in function
. Replacing /Od
by /O1
fixes the problem.