diff --git a/.travis.yml b/.travis.yml index 51e5d7221de1678aae4d42f933adc4ad3fa6cd13..ea0569e361fcb68991acb34148eab7364a2e7be5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -310,7 +310,7 @@ script: ;; esac - mkdir build && cd build && cmake -DJNI=1 .. -DCMAKE_BUILD_TYPE=Release $OPT && make -j4 rocksdb rocksdbjni + mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DWITH_TESTS=0 -DWITH_GFLAGS=0 -DWITH_BENCHMARK_TOOLS=0 -DWITH_TOOLS=0 -DWITH_CORE_TOOLS=1 .. && make -j4 && cd .. && rm -rf build && mkdir build && cd build && cmake -DJNI=1 .. -DCMAKE_BUILD_TYPE=Release $OPT && make -j4 rocksdb rocksdbjni ;; make-gcc4.8) OPT=-DTRAVIS V=1 SKIP_LINK=1 make -j4 all && [ "Linking broken because libgflags compiled with newer ABI" ] diff --git a/CMakeLists.txt b/CMakeLists.txt index 4add6761c27fbc7ed12f479e056efb914c99b1b8..8f7ac239ab0e149b153be81360b689d9e3da9816 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -523,7 +523,6 @@ endif() include_directories(${PROJECT_SOURCE_DIR}) include_directories(${PROJECT_SOURCE_DIR}/include) -include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/third-party/gtest-1.8.1/fused-src) if(WITH_FOLLY_DISTRIBUTED_MUTEX) include_directories(${PROJECT_SOURCE_DIR}/third-party/folly) endif() @@ -890,6 +889,16 @@ else() endif() option(WITH_JNI "build with JNI" OFF) +# Tests are excluded from Release builds +CMAKE_DEPENDENT_OPTION(WITH_TESTS "build with tests" ON + "CMAKE_BUILD_TYPE STREQUAL Debug" OFF) +option(WITH_BENCHMARK_TOOLS "build with benchmarks" ON) +option(WITH_CORE_TOOLS "build with ldb and sst_dump" ON) +option(WITH_TOOLS "build with tools" ON) + +if(WITH_TESTS OR WITH_BENCHMARK_TOOLS OR WITH_TOOLS OR WITH_JNI OR JNI) + include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/third-party/gtest-1.8.1/fused-src) +endif() if(WITH_JNI OR JNI) message(STATUS "JNI library is enabled") add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/java) @@ -965,15 +974,11 @@ if(NOT WIN32 OR ROCKSDB_INSTALL_ON_WINDOWS) ) endif() -# Tests are excluded from Release builds -CMAKE_DEPENDENT_OPTION(WITH_TESTS "build with tests" ON - "CMAKE_BUILD_TYPE STREQUAL Debug" OFF) if(WITH_TESTS) add_subdirectory(third-party/gtest-1.8.1/fused-src/gtest) add_library(testharness STATIC test_util/testharness.cc) target_link_libraries(testharness gtest) - set(TESTS cache/cache_test.cc cache/lru_cache_test.cc @@ -1206,7 +1211,6 @@ if(WITH_TESTS) endif() endif() -option(WITH_BENCHMARK_TOOLS "build with benchmarks" ON) if(WITH_BENCHMARK_TOOLS) add_executable(db_bench tools/db_bench.cc @@ -1245,8 +1249,6 @@ if(WITH_BENCHMARK_TOOLS) ${ROCKSDB_LIB}) endif() -option(WITH_CORE_TOOLS "build with ldb and sst_dump" ON) -option(WITH_TOOLS "build with tools" ON) if(WITH_CORE_TOOLS OR WITH_TOOLS) add_subdirectory(tools) add_custom_target(core_tools