diff options
Diffstat (limited to 'cmake/config-ix.cmake')
-rwxr-xr-x | cmake/config-ix.cmake | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake index 88eaa74..f6eeea9 100755 --- a/cmake/config-ix.cmake +++ b/cmake/config-ix.cmake @@ -94,7 +94,7 @@ endif() check_symbol_exists(getpagesize unistd.h HAVE_GETPAGESIZE) check_symbol_exists(getrusage sys/resource.h HAVE_GETRUSAGE) check_symbol_exists(setrlimit sys/resource.h HAVE_SETRLIMIT) -check_function_exists(isatty HAVE_ISATTY) +check_symbol_exists(isatty unistd.h HAVE_ISATTY) check_symbol_exists(index strings.h HAVE_INDEX) check_symbol_exists(isinf cmath HAVE_ISINF_IN_CMATH) check_symbol_exists(isinf math.h HAVE_ISINF_IN_MATH_H) @@ -287,15 +287,18 @@ include(CheckCXXCompilerFlag) check_cxx_compiler_flag("-Wno-variadic-macros" SUPPORTS_NO_VARIADIC_MACROS_FLAG) -include(GetTargetTriple) -get_target_triple(LLVM_DEFAULT_TARGET_TRIPLE) +include(GetHostTriple) +get_host_triple(LLVM_HOST_TRIPLE) +# By default, we target the host, but this can be overridden at CMake +# invocation time. +set(LLVM_DEFAULT_TARGET_TRIPLE "${LLVM_HOST_TRIPLE}") set(TARGET_TRIPLE "${LLVM_DEFAULT_TARGET_TRIPLE}") # Determine the native architecture. string(TOLOWER "${LLVM_TARGET_ARCH}" LLVM_NATIVE_ARCH) if( LLVM_NATIVE_ARCH STREQUAL "host" ) - string(REGEX MATCH "^[^-]*" LLVM_NATIVE_ARCH ${LLVM_DEFAULT_TARGET_TRIPLE}) + string(REGEX MATCH "^[^-]*" LLVM_NATIVE_ARCH ${LLVM_HOST_TRIPLE}) endif () if (LLVM_NATIVE_ARCH MATCHES "i[2-6]86") |