blob: 8bdfee15c198e80bb6dbb901855004a4a8f118f9 [file] [log] [blame]
Michael J. Spencer10d274d2010-09-24 09:01:13 +00001########################################################################
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 )
18
19if(WIN32)
20 add_definitions(-DGTEST_OS_WINDOWS=1)
21endif()
22
Michael J. Spencer33a390e2010-10-07 18:12:54 +000023if(SUPPORTS_NO_VARIADIC_MACROS_FLAG)
24 add_definitions("-Wno-variadic-macros")
25endif()
26
Oscar Fuentes889c1e72010-10-17 02:26:16 +000027set(LLVM_REQUIRES_RTTI 1)
28add_definitions( -DGTEST_HAS_RTTI=0 )
Oscar Fuentes889c1e72010-10-17 02:26:16 +000029
Duncan Sandsb33790d2013-05-14 13:29:16 +000030if (NOT LLVM_ENABLE_THREADS)
31 add_definitions( -DGTEST_HAS_PTHREAD=0 )
32endif()
33
Justin Holewinski6fa89b72012-06-06 03:11:20 +000034# Visual Studio 2012 only supports up to 8 template parameters in
35# std::tr1::tuple by default, but gtest requires 10
36if(MSVC AND MSVC_VERSION EQUAL 1700)
37 add_definitions(-D_VARIADIC_MAX=10)
38endif ()
39
Oscar Fuentes46d8a932010-09-25 20:25:25 +000040add_llvm_library(gtest
41 googletest/gtest.cc
42 googletest/gtest-death-test.cc
43 googletest/gtest-filepath.cc
44 googletest/gtest-port.cc
Frits van Bommel4d73ec92011-07-27 10:19:32 +000045 googletest/gtest-printers.cc
Oscar Fuentes46d8a932010-09-25 20:25:25 +000046 googletest/gtest-test-part.cc
47 googletest/gtest-typed-test.cc
48 )
Michael J. Spencer10d274d2010-09-24 09:01:13 +000049
Oscar Fuentes46d8a932010-09-25 20:25:25 +000050add_llvm_library(gtest_main
51 UnitTestMain/TestMain.cpp
52 )