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")
CACHE STRING "Semicolon-separated list of targets to build, or \"all\".")
endif( MSVC )
+set(C_INCLUDE_DIRS "" CACHE STRING
+ "Colon separated list of directories clang will search for headers.")
+
+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" )
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()
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)
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} )
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)
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 "")
add_subdirectory(lib/ExecutionEngine/JIT)
add_subdirectory(lib/Target)
add_subdirectory(lib/AsmParser)
-add_subdirectory(lib/Debugger)
add_subdirectory(lib/Archive)
add_subdirectory(projects)
add_subdirectory(tools)
endif()
-option(LLVM_BUILD_EXAMPLES "Build LLVM example programs." ON)
+option(LLVM_BUILD_EXAMPLES "Build LLVM example programs." OFF)
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.