this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Stub `GetCompilerInclude` if not i386 and x86_64.

cpuid.h only supports i386 and x86_64.

Thomas A d974b14b 8be655a6

+23 -21
+23 -21
cmake/compiler_include.cmake
··· 1 1 # Detect the location of compiler-specific header files 2 2 # such as stdbool.h or xmmintrin.h 3 3 function(GetCompilerInclude OutputVar) 4 - file(WRITE "${CMAKE_BINARY_DIR}/cinctest.c" "#include <cpuid.h>") 5 - execute_process(COMMAND "${CMAKE_C_COMPILER}" -M "${CMAKE_BINARY_DIR}/cinctest.c" 6 - RESULT_VARIABLE BuildResult 7 - OUTPUT_VARIABLE BuildOutput 8 - ) 4 + if (TARGET_i386 OR TARGET_x86_64) 5 + file(WRITE "${CMAKE_BINARY_DIR}/cinctest.c" "#include <cpuid.h>") 6 + execute_process(COMMAND "${CMAKE_C_COMPILER}" -M "${CMAKE_BINARY_DIR}/cinctest.c" 7 + RESULT_VARIABLE BuildResult 8 + OUTPUT_VARIABLE BuildOutput 9 + ) 9 10 10 - if (BuildResult) 11 - message(FATAL_ERROR "Cannot detect compiler header include path") 12 - endif (BuildResult) 11 + if (BuildResult) 12 + message(FATAL_ERROR "Cannot detect compiler header include path") 13 + endif (BuildResult) 13 14 14 - separate_arguments(BuildOutput) 15 + separate_arguments(BuildOutput) 15 16 16 - foreach (str ${BuildOutput}) 17 - string(REGEX REPLACE "\n$" "" str "${str}") 18 - # message(STATUS "Output: ${str}") 17 + foreach (str ${BuildOutput}) 18 + string(REGEX REPLACE "\n$" "" str "${str}") 19 + # message(STATUS "Output: ${str}") 19 20 20 - if (str MATCHES "cpuid.h$") 21 - # message(STATUS "Str matched: ${str}") 22 - string(REGEX REPLACE "cpuid\\.h" "" IncPath "${str}") 23 - endif (str MATCHES "cpuid.h$") 24 - endforeach (str) 21 + if (str MATCHES "cpuid.h$") 22 + # message(STATUS "Str matched: ${str}") 23 + string(REGEX REPLACE "cpuid\\.h" "" IncPath "${str}") 24 + endif (str MATCHES "cpuid.h$") 25 + endforeach (str) 25 26 26 - if (NOT IncPath) 27 - message(FATAL_ERROR "Cannot parse compiler output to detect include path") 28 - endif (NOT IncPath) 27 + if (NOT IncPath) 28 + message(FATAL_ERROR "Cannot parse compiler output to detect include path") 29 + endif (NOT IncPath) 29 30 30 - set(${OutputVar} ${IncPath} PARENT_SCOPE) 31 + set(${OutputVar} ${IncPath} PARENT_SCOPE) 32 + endif (TARGET_i386 OR TARGET_x86_64) 31 33 endfunction(GetCompilerInclude) 32 34