Skip to content

Commit

Permalink
[C++] Upgrade to Google Test 1.8.0 and make build more similar with A…
Browse files Browse the repository at this point in the history
…eron.
  • Loading branch information
mjpt777 committed Jan 27, 2019
1 parent 2c0a770 commit 63ff0a0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
14 changes: 10 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ if(SBE_TESTS)

ExternalProject_Add(
gtest
URL ${CMAKE_CURRENT_SOURCE_DIR}/sbe-tool/src/test/lib/gtest-1.7.0.zip
URL_MD5 2d6ec8ccdf5c46b05ba54a9fd1d130d7
URL ${CMAKE_CURRENT_SOURCE_DIR}/cppbuild/googletest-release-1.8.0.zip
URL_MD5 adfafc8512ab65fd3cf7955ef0100ff5
PREFIX "${SBE_THIRDPARTY_BINARY_DIR}/gtest"
BUILD_BYPRODUCTS "${SBE_THIRDPARTY_BINARY_DIR}/gtest/src/gtest-build/${CMAKE_CFG_INTDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX};${SBE_THIRDPARTY_BINARY_DIR}/gtest/src/gtest-build/${CMAKE_CFG_INTDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}"
BUILD_BYPRODUCTS "${SBE_THIRDPARTY_BINARY_DIR}/gtest/src/gtest-build/googlemock/${CMAKE_CFG_INTDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX};${SBE_THIRDPARTY_BINARY_DIR}/gtest/src/gtest-build/googlemock/${CMAKE_CFG_INTDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}"
INSTALL_COMMAND ""
LOG_CONFIGURE ON
LOG_BUILD ON
Expand All @@ -62,6 +62,11 @@ if(SBE_TESTS)
set(GTEST_SOURCE_DIR ${source_dir})
ExternalProject_Get_Property(gtest binary_dir)
set(GTEST_BINARY_DIR ${binary_dir})

set(GTEST_LIBS
${GTEST_BINARY_DIR}/googlemock/${CMAKE_CFG_INTDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gmock${CMAKE_STATIC_LIBRARY_SUFFIX}
${GTEST_BINARY_DIR}/googlemock/${CMAKE_CFG_INTDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gmock_main${CMAKE_STATIC_LIBRARY_SUFFIX}
)
endif()

find_package(Threads)
Expand Down Expand Up @@ -123,7 +128,8 @@ set(CODEC_PERF_SCHEMA_DIR "${CMAKE_CURRENT_SOURCE_DIR}/sbe-benchmarks/src/main/r
set(CODEC_EXAMPLES_SCHEMA_DIR "${CMAKE_CURRENT_SOURCE_DIR}/sbe-samples/src/main/resources")

include_directories(
${GTEST_SOURCE_DIR}/include
${GTEST_SOURCE_DIR}/googletest/include
${GTEST_SOURCE_DIR}/googlemock/include
${CMAKE_CURRENT_SOURCE_DIR}/sbe-tool/src/main/cpp
${CODEC_TARGET_DIR}
)
Expand Down
Binary file added cppbuild/googletest-release-1.8.0.zip
Binary file not shown.
5 changes: 0 additions & 5 deletions sbe-tool/src/test/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@
# limitations under the License.
#

set(GTEST_LIBS
${GTEST_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${LIBPREFIX}gtest${LIBSUFFIX}
${GTEST_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${LIBPREFIX}gtest_main${LIBSUFFIX}
)

function(sbe_test name)
add_executable("${name}" "${name}.cpp")
target_link_libraries("${name}" sbe ${GTEST_LIBS} ${CMAKE_THREAD_LIBS_INIT})
Expand Down
Binary file removed sbe-tool/src/test/lib/gtest-1.7.0.zip
Binary file not shown.

0 comments on commit 63ff0a0

Please sign in to comment.