Skip to content

Commit

Permalink
Updated.
Browse files Browse the repository at this point in the history
  • Loading branch information
EpsilonPrime committed Jul 10, 2023
1 parent bbdbe71 commit 96ca9fd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 6 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ include_directories(src)

add_subdirectory(third_party)

# TODO: Simplify once we can require cmake 3.27 (where CONFIG is default).

# Due to packaging changes we use the combined protobuf/absl packaging if
# available otherwise we fallback to the older protobuf method. TODO: Simplify
# once we can require cmake 3.27 (where CONFIG is default).
# available otherwise we fallback to the older protobuf method.
find_package(Protobuf QUIET CONFIG)
set(ABSL_INCLUDED_WITH_PROTOBUF ON)
if(NOT ${Protobuf_FOUND})
if(${Protobuf_FOUND})
set(ABSL_INCLUDED_WITH_PROTOBUF ON)
else()
find_package(Protobuf REQUIRED)
include_directories(${Protobuf_INCLUDE_DIRS})
set(ABSL_INCLUDED_WITH_PROTOBUF OFF)
Expand Down
4 changes: 3 additions & 1 deletion third_party/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# SPDX-License-Identifier: Apache-2.0

if(NOT ${ABSL_INCLUDED_WITH_PROTOBUF})
if(${ABSL_INCLUDED_WITH_PROTOBUF})
# Remove abseil-cpp from the repo when we can require cmake 3.27.
else()
set(ABSL_PROPAGATE_CXX_STD ON)
add_subdirectory(abseil-cpp)
endif()
Expand Down

0 comments on commit 96ca9fd

Please sign in to comment.