[ASan] Intercept CreateThread on Windows
[blocksruntime.git] / CMakeLists.txt
blob483b673773a71c96e4ff7a3520533059498580d3
1 # See docs/CMake.html for instructions about how to build Compiler-RT with CMake.
3 PROJECT( CompilerRT C )
4 CMAKE_MINIMUM_REQUIRED( VERSION 2.6 )
6 set(PACKAGE_NAME compiler-rt)
7 set(PACKAGE_VERSION 1.0svn)
8 set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
9 set(PACKAGE_BUGREPORT "llvmbugs@cs.uiuc.edu")
11 SET( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules )
13 # add definitions
14 include(DefineCompilerFlags)
16 # Disallow in-source build
17 INCLUDE( MacroEnsureOutOfSourceBuild )
18 MACRO_ENSURE_OUT_OF_SOURCE_BUILD(
19  "${PROJECT_NAME} requires an out of source build. Please create a separate build directory and run 'cmake /path/to/${PROJECT_NAME} [options]' there."
20  )
22 INCLUDE( ${CMAKE_SOURCE_DIR}/cmake/ConfigureChecks.cmake )
23 CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/cmake/config.h.cmake
24                 ${CMAKE_CURRENT_BINARY_DIR}/config.h )
26 INCLUDE_DIRECTORIES(
27  ${CMAKE_CURRENT_BINARY_DIR}
30 SET( Achitectures
31  i386 x86_64 ppc arm
32  )
34 SET( Configurations
35  Debug Release Profile
36  )
38 # Only build Blocks Runtime if the compiler has enough support
39 IF( WIN32 OR MSVC OR HAVE_OSATOMIC_COMPARE_AND_SWAP_INT OR HAVE_SYNC_BOOL_COMPARE_AND_SWAP_INT )
40   SET(BUILD_BLOCKS_RUNTIME TRUE)
41 ELSE( WIN32 OR MSVC OR HAVE_OSATOMIC_COMPARE_AND_SWAP_INT OR HAVE_SYNC_BOOL_COMPARE_AND_SWAP_INT )
42   SET(BUILD_BLOCKS_RUNTIME FALSE)
43 ENDIF( WIN32 OR MSVC OR HAVE_OSATOMIC_COMPARE_AND_SWAP_INT OR HAVE_SYNC_BOOL_COMPARE_AND_SWAP_INT )
45 IF( BUILD_BLOCKS_RUNTIME )
46   ADD_SUBDIRECTORY( BlocksRuntime )
47 ELSE( BUILD_BLOCKS_RUNTIME )
48   MESSAGE(STATUS "No suitable atomic operation routines detected, skipping Blocks Runtime")
49 ENDIF( BUILD_BLOCKS_RUNTIME )
51 ADD_SUBDIRECTORY( lib )
53 # Enable Test Suit:
54 INCLUDE( MacroAddCheckTest )
55 ADD_SUBDIRECTORY( test )