X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=CMakeLists.txt;h=13e358a4619905cae95b45cc6e520173f6c9747a;hb=56243b89e7d5072d2d5498f806679d19ea483dac;hp=d29c784e1c2b1aee1eaf53f1b0cde4a51cdc7d03;hpb=7b1dd9aaf10e5e7db2c29c7e4cf187b0dff6304e;p=oota-llvm.git diff --git a/CMakeLists.txt b/CMakeLists.txt index d29c784e1c2..13e358a4619 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" ) -set(PACKAGE_VERSION "3.0") +set(PACKAGE_VERSION "3.1svn") set_property(GLOBAL PROPERTY USE_FOLDERS ON) @@ -23,9 +23,9 @@ if( LLVM_APPEND_VC_REV ) add_version_info_from_vcs(PACKAGE_VERSION) endif() -set(PACKAGE_NAME llvm) +set(PACKAGE_NAME LLVM) set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") -set(PACKAGE_BUGREPORT "llvmbugs@cs.uiuc.edu") +set(PACKAGE_BUGREPORT "http://llvm.org/bugs/") # Sanity check our source directory to make sure that we are not trying to # generate an in-tree build (unless on MSVC_IDE, where it is ok), and to make @@ -72,6 +72,7 @@ set(LLVM_ALL_TARGETS CBackend CellSPU CppBackend + Hexagon Mips MBlaze MSP430 @@ -89,7 +90,7 @@ if( MSVC ) set(LLVM_TARGETS_TO_BUILD X86 CACHE STRING "Semicolon-separated list of targets to build, or \"all\".") else( MSVC ) - set(LLVM_TARGETS_TO_BUILD ${LLVM_ALL_TARGETS} + set(LLVM_TARGETS_TO_BUILD "all" CACHE STRING "Semicolon-separated list of targets to build, or \"all\".") endif( MSVC ) @@ -164,8 +165,8 @@ if (MSVC OR XCODE) endif() set(LLVM_LIT_ARGS "${LIT_ARGS_DEFAULT}" CACHE STRING "Default options for lit") -# On Win32/Cygwin, provide an option to specify the path to the GnuWin32 tools. -if( WIN32 AND CYGWIN ) +# On Win32 hosts, provide an option to specify the path to the GnuWin32 tools. +if( WIN32 AND NOT CYGWIN ) set(LLVM_LIT_TOOLS_DIR "" CACHE PATH "Path to GnuWin32 tools") endif() @@ -205,6 +206,65 @@ option(LLVM_INCLUDE_TESTS "Generate build targets for the LLVM unit tests." ON) include(config-ix) include(HandleLLVMOptions) +# Verify that we can find a Python interpreter, +include(FindPythonInterp) +if( NOT PYTHONINTERP_FOUND ) + message(FATAL_ERROR +"Unable to find Python interpreter, required for builds and testing. + +Please install Python or specify the PYTHON_EXECUTABLE CMake variable.") +endif() + +###### +# LLVMBuild Integration +# +# We use llvm-build to generate all the data required by the CMake based +# build system in one swoop: +# +# - We generate a file (a CMake fragment) in the object root which contains +# all the definitions that are required by CMake. +# +# - We generate the library table used by llvm-config. +# +# - We generate the dependencies for the CMake fragment, so that we will +# automatically reconfigure outselves. + +set(LLVMBUILDTOOL "${LLVM_MAIN_SRC_DIR}/utils/llvm-build/llvm-build") +set(LLVMCONFIGLIBRARYDEPENDENCIESINC + "${LLVM_BINARY_DIR}/tools/llvm-config/LibraryDependencies.inc") +set(LLVMBUILDCMAKEFRAG + "${LLVM_BINARY_DIR}/LLVMBuild.cmake") +message(STATUS "Constructing LLVMBuild project information") +execute_process( + COMMAND ${PYTHON_EXECUTABLE} ${LLVMBUILDTOOL} + --native-target "${LLVM_NATIVE_ARCH}" + --enable-targets "${LLVM_TARGETS_TO_BUILD}" + --write-library-table ${LLVMCONFIGLIBRARYDEPENDENCIESINC} + --write-cmake-fragment ${LLVMBUILDCMAKEFRAG} + ERROR_VARIABLE LLVMBUILDOUTPUT + ERROR_VARIABLE LLVMBUILDERRORS + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE LLVMBUILDRESULT) + +# On Win32, CMake doesn't properly handle piping the default output/error +# streams into the GUI console. So, we explicitly catch and report them. +if( NOT "${LLVMBUILDOUTPUT}" STREQUAL "") + message(STATUS "llvm-build output: ${LLVMBUILDOUTPUT}") +endif() +if( NOT "${LLVMBUILDRESULT}" STREQUAL "0" ) + message(FATAL_ERROR + "Unexpected failure executing llvm-build: ${LLVMBUILDERRORS}") +endif() + +# Include the generated CMake fragment. This will define properties from the +# LLVMBuild files in a format which is easy to consume from CMake, and will add +# the dependencies so that CMake will reconfigure properly when the LLVMBuild +# files change. +include(${LLVMBUILDCMAKEFRAG}) + +###### + # Configure all of the various header file fragments LLVM uses which depend on # configuration variables. set(LLVM_ENUM_ASM_PRINTERS "") @@ -293,6 +353,7 @@ add_subdirectory(utils/FileUpdate) add_subdirectory(utils/count) add_subdirectory(utils/not) add_subdirectory(utils/llvm-lit) +add_subdirectory(utils/json-bench) add_subdirectory(projects)