Relax dependency on googletest and allow customization of cctz target

This commit is contained in:
Roman Gershman 2017-12-23 00:25:36 +02:00
parent ff70456473
commit 765541cd5e
2 changed files with 19 additions and 14 deletions

View file

@ -58,17 +58,21 @@ list(APPEND ABSL_COMMON_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_CXX_FLAGS "${ABSL_STD_CXX_FLAG} ${CMAKE_CXX_FLAGS}") set(CMAKE_CXX_FLAGS "${ABSL_STD_CXX_FLAG} ${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_WARNING_VLA} ${CMAKE_CXX_FLAGS} ") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_WARNING_VLA} ${CMAKE_CXX_FLAGS} ")
# find dependencies # find dependencies
## pthread ## pthread
find_package(Threads REQUIRED) find_package(Threads REQUIRED)
if(NOT CCTZ_TARGET)
set(CCTZ_TARGET cctz)
endif()
# commented: used only for standalone test # commented: used only for standalone test
#add_subdirectory(cctz) #add_subdirectory(cctz)
#add_subdirectory(googletest) #add_subdirectory(googletest)
check_target({${CCTZ_TARGET})
## check targets ## check targets
check_target(cctz) if(BUILD_TESTING)
check_target(gtest) check_target(gtest)
check_target(gtest_main) check_target(gtest_main)
check_target(gmock) check_target(gmock)
@ -82,5 +86,6 @@ list(APPEND ABSL_TEST_COMMON_LIBRARIES
gmock gmock
${CMAKE_THREAD_LIBS_INIT} ${CMAKE_THREAD_LIBS_INIT}
) )
endif()
add_subdirectory(absl) add_subdirectory(absl)

View file

@ -32,7 +32,7 @@ list(APPEND TIME_SRC
${TIME_PUBLIC_HEADERS} ${TIME_PUBLIC_HEADERS}
${TIME_INTERNAL_HEADERS} ${TIME_INTERNAL_HEADERS}
) )
set(TIME_PUBLIC_LIBRARIES absl::base absl::stacktrace absl::int128 cctz) set(TIME_PUBLIC_LIBRARIES absl::base absl::stacktrace absl::int128 {CCTZ_TARGET})
absl_library( absl_library(
TARGET TARGET