Skip to content

Commit

Permalink
BUILD: Add CMake option to build with Abseil
Browse files Browse the repository at this point in the history
  • Loading branch information
DrMcCoy committed Oct 5, 2023
1 parent b6f32c5 commit 42ee7c5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ set(xoreos-tools_VERSION 0.0.6)
# -------------------------------------------------------------------------
# options!
option(Boost_USE_STATIC_LIBS "Use Boost static libraries" OFF)

option(GTest_HAS_ABSEIL "Use Abseil and RE2 for Google Test" OFF)

# -------------------------------------------------------------------------
# load some cmake modules from cmake/ subfolder
Expand Down Expand Up @@ -350,6 +350,13 @@ install(

# -------------------------------------------------------------------------
# unit tests, parsed from the Automake rules.mk files
set(TEST_LIBRARIES ${XOREOSTOOLS_LIBRARIES})
if(GTest_HAS_ABSEIL)
find_package(absl REQUIRED)
add_definitions(-DGTEST_HAS_ABSL)
list(APPEND TEST_LIBRARIES absl::container absl::debugging absl::flags absl::strings absl::types)
endif()

enable_testing()
parse_automake(tests/rules.mk)

Expand Down

0 comments on commit 42ee7c5

Please sign in to comment.