1# This file is used for non-server builds (e.g. for Couchbase mobile)
2
3IF (NOT CMAKE_BUILD_TYPE)
4   SET(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
5       "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel."
6       FORCE)
7ENDIF (NOT CMAKE_BUILD_TYPE)
8message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
9
10# If GoogleTest is checked out then include it and we can run some tests
11IF(EXISTS "${phosphor_SOURCE_DIR}/thirdparty/google/googletest/CMakeLists.txt")
12    SET(gtest_force_shared_crt ON CACHE BOOL
13        "Use shared (DLL) run-time lib even when Google Test
14        is built as static lib.")
15    ADD_SUBDIRECTORY(${phosphor_SOURCE_DIR}/thirdparty/google/googletest EXCLUDE_FROM_ALL)
16ENDIF ()
17
18IF(EXISTS "${phosphor_SOURCE_DIR}/thirdparty/google/benchmark/CMakeLists.txt")
19    option(BENCHMARK_ENABLE_TESTING "Enable testing of the benchmark library." OFF)
20    ADD_SUBDIRECTORY(${phosphor_SOURCE_DIR}/thirdparty/google/benchmark EXCLUDE_FROM_ALL)
21ENDIF ()
22
23IF(EXISTS "${phosphor_SOURCE_DIR}/thirdparty/couchbase/tlm/CMakeLists.txt")
24    SET(CMAKE_MODULE_PATH
25            ${CMAKE_MODULE_PATH}
26            "${phosphor_SOURCE_DIR}/thirdparty/couchbase/tlm/cmake/Modules")
27ELSE()
28    MESSAGE(FATAL_ERROR
29            "couchbase/tlm is required to be checked out for non-server builds"
30            " (Try: `git submodule update thirdparty/couchbase/tlm`)")
31ENDIF()
32
33# Include some of the compiler flag modules from couchbase/tlm
34INCLUDE(CouchbaseCompilerOptions)
35INCLUDE(CouchbaseCodeCoverage)
36INCLUDE(CouchbaseThreadSanitizer)
37INCLUDE(CouchbaseAddressSanitizer)
38