1########################################################################
2# Experimental CMake build script for Google Test.
3#
4# Consider this a prototype.  It will change drastically.  For now,
5# this is only for people on the cutting edge.
6#
7# To run the tests for Google Test itself on Linux, use 'make test' or
8# ctest.  You can select which tests to run using 'ctest -R regex'.
9# For more options, run 'ctest --help'.
10########################################################################
11#
12# Project-wide settings
13
14# Where gtest's .h files can be found.
15include_directories(
16  googletest/include
17  googletest
18  )
19
20if(WIN32)
21  add_definitions(-DGTEST_OS_WINDOWS=1)
22endif()
23
24if(SUPPORTS_NO_VARIADIC_MACROS_FLAG)
25  add_definitions("-Wno-variadic-macros")
26endif()
27
28set(LLVM_REQUIRES_RTTI 1)
29add_definitions( -DGTEST_HAS_RTTI=0 )
30
31if (NOT LLVM_ENABLE_THREADS)
32  add_definitions( -DGTEST_HAS_PTHREAD=0 )
33endif()
34
35set(LIBS
36  LLVMSupport # Depends on llvm::raw_ostream
37)
38
39find_library(PTHREAD_LIBRARY_PATH pthread)
40if (PTHREAD_LIBRARY_PATH)
41  list(APPEND LIBS pthread)
42endif()
43
44add_llvm_library(gtest
45  googletest/src/gtest-all.cc
46
47  LINK_LIBS
48  ${LIBS}
49)
50
51add_subdirectory(UnitTestMain)
52