diff options
author | Chris Robinson <[email protected]> | 2014-08-11 14:19:15 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-08-11 14:19:15 -0700 |
commit | 74c8de6372bc84916551a6685f337e69017eb239 (patch) | |
tree | a2c1cd64d5cf67b6c6256f13fdec4942aa4b1f3b /CMakeLists.txt | |
parent | e3ee534c3961c4a7c9961019a242693e0da402ef (diff) |
Try the __cpuid intrinsic if GCC's __get_cpuid isn't available
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index cbb6844b..f1de92d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -351,6 +351,7 @@ CHECK_INCLUDE_FILE(ftw.h HAVE_FTW_H) CHECK_INCLUDE_FILE(io.h HAVE_IO_H) CHECK_INCLUDE_FILE(strings.h HAVE_STRINGS_H) CHECK_INCLUDE_FILE(cpuid.h HAVE_CPUID_H) +CHECK_INCLUDE_FILE(intrin.h HAVE_INTRIN_H) CHECK_INCLUDE_FILE(sys/sysconf.h HAVE_SYS_SYSCONF_H) CHECK_INCLUDE_FILE(fenv.h HAVE_FENV_H) CHECK_INCLUDE_FILE(float.h HAVE_FLOAT_H) @@ -369,6 +370,16 @@ IF(HAVE_CPUID_H) }" HAVE_GCC_GET_CPUID) ENDIF() +IF(HAVE_INTRIN_H) + CHECK_C_SOURCE_COMPILES("#include <intrin.h> + int main() + { + int regs[4]; + __cpuid(regs, 0); + return regs[0]; + }" HAVE_CPUID_INTRINSIC) +ENDIF() + # Some systems need libm for some of the following math functions to work CHECK_LIBRARY_EXISTS(m pow "" HAVE_LIBM) IF(HAVE_LIBM) |