143c53ef0SWill Gardner# This file is used for non-server builds (e.g. for Couchbase mobile)
243c53ef0SWill Gardner
3729709b8SWill GardnerIF (NOT CMAKE_BUILD_TYPE)
4729709b8SWill Gardner   SET(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
5729709b8SWill Gardner       "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel."
6729709b8SWill Gardner       FORCE)
7729709b8SWill GardnerENDIF (NOT CMAKE_BUILD_TYPE)
8729709b8SWill Gardnermessage(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
9729709b8SWill Gardner
1043c53ef0SWill Gardner# If GoogleTest is checked out then include it and we can run some tests
11d8b578f8SWill GardnerIF(EXISTS "${phosphor_SOURCE_DIR}/thirdparty/google/googletest/CMakeLists.txt")
12e2085bb5SWill Gardner    SET(gtest_force_shared_crt ON CACHE BOOL
13e2085bb5SWill Gardner        "Use shared (DLL) run-time lib even when Google Test
14e2085bb5SWill Gardner        is built as static lib.")
15d8b578f8SWill Gardner    ADD_SUBDIRECTORY(${phosphor_SOURCE_DIR}/thirdparty/google/googletest EXCLUDE_FROM_ALL)
1643c53ef0SWill GardnerENDIF ()
1743c53ef0SWill Gardner
188476e923SWill GardnerIF(EXISTS "${phosphor_SOURCE_DIR}/thirdparty/google/benchmark/CMakeLists.txt")
190feb2555SWill Gardner    option(BENCHMARK_ENABLE_TESTING "Enable testing of the benchmark library." OFF)
208476e923SWill Gardner    ADD_SUBDIRECTORY(${phosphor_SOURCE_DIR}/thirdparty/google/benchmark EXCLUDE_FROM_ALL)
218476e923SWill GardnerENDIF ()
228476e923SWill Gardner
23d8b578f8SWill GardnerIF(EXISTS "${phosphor_SOURCE_DIR}/thirdparty/couchbase/tlm/CMakeLists.txt")
24ab5f28cdSWill Gardner    SET(CMAKE_MODULE_PATH
25ab5f28cdSWill Gardner            ${CMAKE_MODULE_PATH}
26ab5f28cdSWill Gardner            "${phosphor_SOURCE_DIR}/thirdparty/couchbase/tlm/cmake/Modules")
27ab5f28cdSWill GardnerELSE()
28ab5f28cdSWill Gardner    MESSAGE(FATAL_ERROR
29ab5f28cdSWill Gardner            "couchbase/tlm is required to be checked out for non-server builds"
30ab5f28cdSWill Gardner            " (Try: `git submodule update thirdparty/couchbase/tlm`)")
31ab5f28cdSWill GardnerENDIF()
3243c53ef0SWill Gardner
3343c53ef0SWill Gardner# Include some of the compiler flag modules from couchbase/tlm
3443c53ef0SWill GardnerINCLUDE(CouchbaseCompilerOptions)
35ae88dacbSchippiewillINCLUDE(CouchbaseCodeCoverage)
36ae88dacbSchippiewillINCLUDE(CouchbaseThreadSanitizer)
37ae88dacbSchippiewillINCLUDE(CouchbaseAddressSanitizer)
38