X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=CMakeLists.txt;h=794e8e951c6ab8e64224375febfc7f420a211f69;hb=b8e0ebf034a473ac4a5ff477d4bf653b70c778a4;hp=ae858f579453f4ddd5bffe978ad6e2a90e525512;hpb=34888816e802fb83a84ca0c7cc7b7a21d9fcd764;p=oota-llvm.git diff --git a/CMakeLists.txt b/CMakeLists.txt index ae858f57945..794e8e951c6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ project(LLVM) cmake_minimum_required(VERSION 2.6.1) set(PACKAGE_NAME llvm) -set(PACKAGE_VERSION 2.6svn) +set(PACKAGE_VERSION 2.7svn) set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") set(PACKAGE_BUGREPORT "llvmbugs@cs.uiuc.edu") @@ -70,6 +70,9 @@ else( MSVC ) CACHE STRING "Semicolon-separated list of targets to build, or \"all\".") endif( MSVC ) +set(LLVM_TARGET_ARCH "host" + CACHE STRING "Set target to use for LLVM JIT or use \"host\" for automatic detection.") + option(LLVM_ENABLE_THREADS "Use threads if available." ON) if( uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" ) @@ -94,12 +97,6 @@ else() endif() endif() -if( uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" AND NOT LLVM_ENABLE_ASSERTIONS ) - set( LLVM_COMPACT_SENTINELS 1 ) -else( uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" AND NOT LLVM_ENABLE_ASSERTIONS ) - set( LLVM_COMPACT_SENTINELS 0 ) -endif( uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" AND NOT LLVM_ENABLE_ASSERTIONS ) - if( LLVM_TARGETS_TO_BUILD STREQUAL "all" ) set( LLVM_TARGETS_TO_BUILD ${LLVM_ALL_TARGETS} ) endif() @@ -148,7 +145,11 @@ else(WIN32) if(UNIX) set(LLVM_ON_WIN32 0) set(LLVM_ON_UNIX 1) - set(LTDL_SHLIB_EXT ".so") + if(APPLE) + set(LTDL_SHLIB_EXT ".dylib") + else(APPLE) + set(LTDL_SHLIB_EXT ".so") + endif(APPLE) set(EXEEXT "") # FIXME: Maximum path length is currently set to 'safe' fixed value set(MAXPATHLEN 2024) @@ -159,17 +160,23 @@ endif(WIN32) include(config-ix) -option(LLVM_ENABLE_PIC "Build Position-Independent Code" OFF) +option(LLVM_ENABLE_PIC "Build Position-Independent Code" ON) set(ENABLE_PIC 0) if( LLVM_ENABLE_PIC ) - if( SUPPORTS_FPIC_FLAG ) - message(STATUS "Building with -fPIC") - add_llvm_definitions(-fPIC) - set(ENABLE_PIC 1) - else( SUPPORTS_FPIC_FLAG ) - message(STATUS "Warning: -fPIC not supported.") - endif() + if( XCODE ) + # Xcode has -mdynamic-no-pic on by default, which overrides -fPIC. I don't + # know how to disable this, so just force ENABLE_PIC off for now. + message(STATUS "Warning: -fPIC not supported with Xcode.") + else( XCODE ) + if( SUPPORTS_FPIC_FLAG ) + message(STATUS "Building with -fPIC") + add_llvm_definitions(-fPIC) + set(ENABLE_PIC 1) + else( SUPPORTS_FPIC_FLAG ) + message(STATUS "Warning: -fPIC not supported.") + endif() + endif() endif() set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_TOOLS_BINARY_DIR} ) @@ -220,6 +227,10 @@ endif( MSVC ) include_directories( ${LLVM_BINARY_DIR}/include ${LLVM_MAIN_INCLUDE_DIR}) +if( ${CMAKE_SYSTEM_NAME} MATCHES SunOS ) + SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-include llvm/System/Solaris.h") +endif( ${CMAKE_SYSTEM_NAME} MATCHES SunOS ) + include(AddLLVM) include(TableGen) @@ -258,8 +269,11 @@ add_subdirectory(lib/Linker) add_subdirectory(lib/Analysis) add_subdirectory(lib/Analysis/IPA) add_subdirectory(lib/MC) +add_subdirectory(test) add_subdirectory(utils/FileCheck) +add_subdirectory(utils/count) +add_subdirectory(utils/not) set(LLVM_ENUM_ASM_PRINTERS "") set(LLVM_ENUM_ASM_PARSERS "") @@ -297,7 +311,6 @@ add_subdirectory(lib/ExecutionEngine/Interpreter) add_subdirectory(lib/ExecutionEngine/JIT) add_subdirectory(lib/Target) add_subdirectory(lib/AsmParser) -add_subdirectory(lib/Debugger) add_subdirectory(lib/Archive) add_subdirectory(projects) @@ -312,16 +325,26 @@ if(LLVM_BUILD_EXAMPLES) add_subdirectory(examples) endif () -install(DIRECTORY include - DESTINATION . +install(DIRECTORY include/ + DESTINATION include + FILES_MATCHING + PATTERN "*.def" + PATTERN "*.h" + PATTERN "*.td" + PATTERN "*.inc" PATTERN ".svn" EXCLUDE - PATTERN "*.cmake" EXCLUDE - PATTERN "*.in" EXCLUDE - PATTERN "*.tmp" EXCLUDE ) -install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include - DESTINATION . +install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/ + DESTINATION include + FILES_MATCHING + PATTERN "*.def" + PATTERN "*.h" + PATTERN "*.gen" + PATTERN "*.inc" + # Exclude include/llvm/CMakeFiles/intrinsics_gen.dir, matched by "*.def" + PATTERN "CMakeFiles" EXCLUDE + PATTERN ".svn" EXCLUDE ) # TODO: make and install documentation.