Skip to content

Commit

Permalink
Only load absl from third party if we do not use the bundled version …
Browse files Browse the repository at this point in the history
…from protobuf.
  • Loading branch information
EpsilonPrime committed Jul 10, 2023
1 parent 4df4e73 commit f3c6d24
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 5 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ include_directories(src)
add_subdirectory(third_party)

# 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. TODO: Simplify
# once we can require cmake 3.27 (where CONFIG is default).
find_package(Protobuf QUIET CONFIG)
if(NOT ${Protobuf_FOUND})
if(${Protobuf_FOUND})
set(PROTOBUF_LOADED_AS_CONFIG)
else()
find_package(Protobuf REQUIRED)
include_directories(${Protobuf_INCLUDE_DIRS})
endif()
Expand Down
6 changes: 4 additions & 2 deletions third_party/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# SPDX-License-Identifier: Apache-2.0

set(ABSL_PROPAGATE_CXX_STD ON)
add_subdirectory(abseil-cpp)
if(NOT ${PROTOBUF_LOADED_AS_CONFIG})
set(ABSL_PROPAGATE_CXX_STD ON)
add_subdirectory(abseil-cpp)
endif()

set(BUILD_TZ_LIB ON)
add_subdirectory(datetime)
Expand Down

0 comments on commit f3c6d24

Please sign in to comment.