2009-08-03 09:08:25 +08:00
|
|
|
# See docs/CMake.html for instructions about how to build Compiler-RT with CMake.
|
|
|
|
|
2009-08-10 02:41:02 +08:00
|
|
|
PROJECT( CompilerRT C )
|
2009-08-03 10:15:06 +08:00
|
|
|
CMAKE_MINIMUM_REQUIRED( VERSION 2.6 )
|
2009-08-03 09:08:25 +08:00
|
|
|
|
|
|
|
set(PACKAGE_NAME compiler-rt)
|
|
|
|
set(PACKAGE_VERSION 1.0svn)
|
|
|
|
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
|
|
|
|
set(PACKAGE_BUGREPORT "llvmbugs@cs.uiuc.edu")
|
|
|
|
|
2009-08-03 13:59:48 +08:00
|
|
|
SET( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules )
|
|
|
|
|
2009-08-05 09:47:29 +08:00
|
|
|
# add definitions
|
|
|
|
include(DefineCompilerFlags)
|
|
|
|
|
2009-08-03 13:59:48 +08:00
|
|
|
# Disallow in-source build
|
|
|
|
INCLUDE( MacroEnsureOutOfSourceBuild )
|
|
|
|
MACRO_ENSURE_OUT_OF_SOURCE_BUILD(
|
|
|
|
"${PROJECT_NAME} requires an out of source build. Please create a separate build directory and run 'cmake /path/to/${PROJECT_NAME} [options]' there."
|
|
|
|
)
|
2009-08-03 09:08:25 +08:00
|
|
|
|
2009-08-05 09:47:29 +08:00
|
|
|
INCLUDE( ConfigureChecks.cmake )
|
|
|
|
CONFIGURE_FILE( config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h )
|
|
|
|
|
2009-09-13 00:44:57 +08:00
|
|
|
INCLUDE_DIRECTORIES(
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
)
|
|
|
|
|
2009-08-10 02:41:02 +08:00
|
|
|
SET( Achitectures
|
2009-09-14 20:45:07 +08:00
|
|
|
i386 x86_64 ppc arm
|
2009-08-10 02:41:02 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
SET( Configurations
|
|
|
|
Debug Release Profile
|
|
|
|
)
|
|
|
|
|
2009-09-24 00:05:25 +08:00
|
|
|
# Only build Blocks Runtime if the compiler has enough support
|
|
|
|
IF( WIN32 OR MSVC OR HAVE_OSATOMIC_COMPARE_AND_SWAP_INT OR HAVE_SYNC_BOOL_COMPARE_AND_SWAP_INT )
|
|
|
|
SET(BUILD_BLOCKS_RUNTIME TRUE)
|
|
|
|
ELSE( WIN32 OR MSVC OR HAVE_OSATOMIC_COMPARE_AND_SWAP_INT OR HAVE_SYNC_BOOL_COMPARE_AND_SWAP_INT )
|
|
|
|
SET(BUILD_BLOCKS_RUNTIME FALSE)
|
|
|
|
ENDIF( WIN32 OR MSVC OR HAVE_OSATOMIC_COMPARE_AND_SWAP_INT OR HAVE_SYNC_BOOL_COMPARE_AND_SWAP_INT )
|
|
|
|
|
|
|
|
IF( BUILD_BLOCKS_RUNTIME )
|
|
|
|
ADD_SUBDIRECTORY( BlocksRuntime )
|
|
|
|
ELSE( BUILD_BLOCKS_RUNTIME )
|
|
|
|
MESSAGE(STATUS "No suitable atomic operation routines detected, skipping Blocks Runtime")
|
|
|
|
ENDIF( BUILD_BLOCKS_RUNTIME )
|
|
|
|
|
2009-08-03 09:08:25 +08:00
|
|
|
ADD_SUBDIRECTORY( lib )
|
2009-08-05 09:47:29 +08:00
|
|
|
|
2009-11-01 05:08:10 +08:00
|
|
|
# Enable Test Suit:
|
2009-10-28 07:23:41 +08:00
|
|
|
INCLUDE( MacroAddCheckTest )
|
2009-10-17 18:19:32 +08:00
|
|
|
ADD_SUBDIRECTORY( test )
|