Changeset View
Changeset View
Standalone View
Standalone View
compiler-rt/cmake/base-config-ix.cmake
# The CompilerRT build system requires CMake version 2.8.8 or higher in order | # The CompilerRT build system requires CMake version 2.8.8 or higher in order | ||||
# to use its support for building convenience "libraries" as a collection of | # to use its support for building convenience "libraries" as a collection of | ||||
# .o files. This is particularly useful in producing larger, more complex | # .o files. This is particularly useful in producing larger, more complex | ||||
# runtime libraries. | # runtime libraries. | ||||
include(BuiltinTests) | include(BuiltinTests) | ||||
include(CheckIncludeFile) | include(CheckIncludeFile) | ||||
include(CheckCXXSourceCompiles) | include(CheckCXXSourceCompiles) | ||||
include(GNUInstallDirs) | include(GNUInstallDirs) | ||||
include(GetClangResourceDir) | |||||
include(ExtendPath) | include(ExtendPath) | ||||
check_include_file(unwind.h HAVE_UNWIND_H) | check_include_file(unwind.h HAVE_UNWIND_H) | ||||
# Used by sanitizer_common and tests. | # Used by sanitizer_common and tests. | ||||
check_include_file(rpc/xdr.h HAVE_RPC_XDR_H) | check_include_file(rpc/xdr.h HAVE_RPC_XDR_H) | ||||
if (NOT HAVE_RPC_XDR_H) | if (NOT HAVE_RPC_XDR_H) | ||||
set(HAVE_RPC_XDR_H 0) | set(HAVE_RPC_XDR_H 0) | ||||
Show All 20 Lines | |||||
if (LLVM_TREE_AVAILABLE) | if (LLVM_TREE_AVAILABLE) | ||||
# Compute the Clang version from the LLVM version. | # Compute the Clang version from the LLVM version. | ||||
# FIXME: We should be able to reuse CLANG_VERSION_MAJOR variable calculated | # FIXME: We should be able to reuse CLANG_VERSION_MAJOR variable calculated | ||||
# in Clang cmake files, instead of copying the rules here. | # in Clang cmake files, instead of copying the rules here. | ||||
string(REGEX MATCH "^[0-9]+" CLANG_VERSION_MAJOR | string(REGEX MATCH "^[0-9]+" CLANG_VERSION_MAJOR | ||||
${PACKAGE_VERSION}) | ${PACKAGE_VERSION}) | ||||
# Setup the paths where compiler-rt runtimes and headers should be stored. | # Setup the paths where compiler-rt runtimes and headers should be stored. | ||||
set(COMPILER_RT_OUTPUT_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION_MAJOR}) | get_clang_resource_dir(COMPILER_RT_OUTPUT_DIR PREFIX ${LLVM_BINARY_DIR}) | ||||
set(COMPILER_RT_EXEC_OUTPUT_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR}) | set(COMPILER_RT_EXEC_OUTPUT_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR}) | ||||
set(COMPILER_RT_INSTALL_PATH lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION_MAJOR}) | get_clang_resource_dir(COMPILER_RT_INSTALL_PATH) | ||||
option(COMPILER_RT_INCLUDE_TESTS "Generate and build compiler-rt unit tests." | option(COMPILER_RT_INCLUDE_TESTS "Generate and build compiler-rt unit tests." | ||||
${LLVM_INCLUDE_TESTS}) | ${LLVM_INCLUDE_TESTS}) | ||||
option(COMPILER_RT_ENABLE_WERROR "Fail and stop if warning is triggered" | option(COMPILER_RT_ENABLE_WERROR "Fail and stop if warning is triggered" | ||||
${LLVM_ENABLE_WERROR}) | ${LLVM_ENABLE_WERROR}) | ||||
# Use just-built Clang to compile/link tests on all platforms. | # Use just-built Clang to compile/link tests on all platforms. | ||||
if (CMAKE_CROSSCOMPILING) | if (CMAKE_CROSSCOMPILING) | ||||
if (CMAKE_HOST_WIN32) | if (CMAKE_HOST_WIN32) | ||||
▲ Show 20 Lines • Show All 207 Lines • Show Last 20 Lines |