X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=CMakeLists.txt;h=cfbf9562f0385d51a35c6cc6c857cf6d14c408c5;hb=7775242da34fcacdec50b28daec173084be618ad;hp=4f00395fd60be8e726251724309f2b75f9d54f3e;hpb=c4300b9c0147889e77d2a51ded9fa025545d27e2;p=oota-llvm.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 4f00395fd60..cfbf9562f03 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,11 @@ cmake_minimum_required(VERSION 2.8.8) +if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + message(STATUS "No build type selected, default to Debug") + set(CMAKE_BUILD_TYPE "Debug") +endif() + # FIXME: It may be removed when we use 2.8.12. if(CMAKE_VERSION VERSION_LESS 2.8.12) # Invalidate a couple of keywords. @@ -16,6 +21,15 @@ else() endif() endif() +if (POLICY CMP0051) + # CMake 3.1 and higher include generator expressions of the form + # $ in the SOURCES property. These need to be + # stripped everywhere that access the SOURCES property, so we just + # defer to the OLD behavior of not including generator expressions + # in the output for now. + cmake_policy(SET CMP0051 OLD) +endif() + if(CMAKE_VERSION VERSION_LESS 3.1.20141117) set(cmake_3_2_USES_TERMINAL) else() @@ -24,10 +38,6 @@ endif() project(LLVM) -if (MSVC AND MSVC_VERSION LESS 1800) - message(FATAL_ERROR "Minimum required MSVC version is 2013!") -endif () - # The following only works with the Ninja generator in CMake >= 3.0. set(LLVM_PARALLEL_COMPILE_JOBS "" CACHE STRING "Define the maximum number of concurrent compilation jobs.") @@ -53,9 +63,11 @@ set(CMAKE_MODULE_PATH set(LLVM_VERSION_MAJOR 3) set(LLVM_VERSION_MINOR 7) set(LLVM_VERSION_PATCH 0) +set(LLVM_VERSION_SUFFIX svn) if (NOT PACKAGE_VERSION) - set(PACKAGE_VERSION "${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}svn") + set(PACKAGE_VERSION + "${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}${LLVM_VERSION_SUFFIX}") endif() option(LLVM_INSTALL_TOOLCHAIN_ONLY "Only include toolchain files in the 'install' target." OFF) @@ -240,6 +252,7 @@ endif() option(LLVM_ENABLE_MODULES "Compile with C++ modules enabled." OFF) option(LLVM_ENABLE_CXX1Y "Compile with C++1y enabled." OFF) option(LLVM_ENABLE_LIBCXX "Use libc++ if available." OFF) +option(LLVM_ENABLE_LIBCXXABI "Use libc++abi when using libc++." OFF) option(LLVM_ENABLE_PEDANTIC "Compile with pedantic enabled." ON) option(LLVM_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF) @@ -337,6 +350,11 @@ if(LLVM_DISABLE_LLVM_DYLIB_ATEXIT) set(DISABLE_LLVM_DYLIB_ATEXIT 1) endif() +option(LLVM_OPTIMIZED_TABLEGEN "Force TableGen to be built with optimization" OFF) +if(CMAKE_CROSSCOMPILING OR (LLVM_OPTIMIZED_TABLEGEN AND LLVM_ENABLE_ASSERTIONS)) + set(LLVM_USE_HOST_TOOLS ON) +endif() + # All options referred to from HandleLLVMOptions have to be specified # BEFORE this include, otherwise options will not be correctly set on # first cmake run @@ -523,9 +541,9 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) include_directories( ${LLVM_INCLUDE_DIR} ${LLVM_MAIN_INCLUDE_DIR}) # when crosscompiling import the executable targets from a file -if(CMAKE_CROSSCOMPILING) +if(LLVM_USE_HOST_TOOLS) include(CrossCompile) -endif(CMAKE_CROSSCOMPILING) +endif(LLVM_USE_HOST_TOOLS) if( ${CMAKE_SYSTEM_NAME} MATCHES FreeBSD ) # On FreeBSD, /usr/local/* is not used by default. In order to build LLVM @@ -634,6 +652,7 @@ add_subdirectory(cmake/modules) if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) install(DIRECTORY include/llvm include/llvm-c DESTINATION include + COMPONENT llvm-headers FILES_MATCHING PATTERN "*.def" PATTERN "*.h" @@ -645,6 +664,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) install(DIRECTORY ${LLVM_INCLUDE_DIR}/llvm DESTINATION include + COMPONENT llvm-headers FILES_MATCHING PATTERN "*.def" PATTERN "*.h" @@ -655,4 +675,12 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) PATTERN "config.h" EXCLUDE PATTERN ".svn" EXCLUDE ) + + if (NOT CMAKE_CONFIGURATION_TYPES) + add_custom_target(installhdrs + DEPENDS ${name} + COMMAND "${CMAKE_COMMAND}" + -DCMAKE_INSTALL_COMPONENT=llvm-headers + -P "${CMAKE_BINARY_DIR}/cmake_install.cmake") + endif() endif()