Skip to content

Commit

Permalink
Update dependencies to most recent versions
Browse files Browse the repository at this point in the history
- Remove protobuf workaround for `cmake/` sub-directory
- Suppress "file has no symbols" warning on macOS

PiperOrigin-RevId: 452774099
Change-Id: I0aad124789a304cfa06062e1db71bcb0e74f5223
  • Loading branch information
cblichmann authored and copybara-github committed Jun 3, 2022
1 parent b144f86 commit c6cf16a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
9 changes: 4 additions & 5 deletions cmake/BinExportDeps.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ include(FetchContent)
# Googletest
FetchContent_Declare(googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG 9ca071b6e55568dff6960bebe1a5cfaa180fb3ce # 2021-11-10
GIT_TAG 0320f517fd920866d918e564105d68fd4362040a # 2022-06-01
)
FetchContent_MakeAvailable(googletest)
binexport_check_target(gtest)
Expand All @@ -35,19 +35,18 @@ binexport_check_target(gmock)
# Abseil
FetchContent_Declare(absl
GIT_REPOSITORY https://github.com/abseil/abseil-cpp
GIT_TAG f2dbd918d8d08529800eb72f23bd2829f92104a4 # 2021-11-11
GIT_TAG fa5d5f4c262ce3d42bfe35439913162aef45ee23 # 2022-06-02
)
set(ABSL_CXX_STANDARD ${CMAKE_CXX_STANDARD} CACHE STRING "" FORCE)
set(ABSL_PROPAGATE_CXX_STD ON CACHE BOOL "" FORCE)
set(ABSL_USE_EXTERNAL_GOOGLETEST ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(absl)
binexport_check_target(absl::core_headers)

# Protocol Buffers
FetchContent_Declare(protobuf
GIT_REPOSITORY https://github.com/protocolbuffers/protobuf.git
GIT_TAG 47e05427e3341c9b18fff047e7d9f79af0dafe9b # 2021-11-11
GIT_SUBMODULES "cmake" # Workaround for CMake #20579
SOURCE_SUBDIR cmake
GIT_TAG v21.1 # 2022-05-28
)
set(protobuf_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(protobuf_BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
Expand Down
15 changes: 14 additions & 1 deletion cmake/CompileOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX})

if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") # GCC
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") # Clang or Apple Clang
add_compile_options(-Wno-nullability-completeness)
add_compile_options(
-Wno-nullability-completeness
-Wno-invalid-noreturn
)
elseif(MSVC) # Visual Studio
add_compile_options(
/wd4018 # signed/unsigned mismatch
Expand Down Expand Up @@ -54,6 +57,16 @@ if(UNIX)
if(APPLE)
add_compile_options(-gfull)
add_link_options(-dead_strip)

# Suppress ranlib warnings "file has no symbols"
set(CMAKE_C_ARCHIVE_CREATE
"<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_CXX_ARCHIVE_CREATE
"<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_C_ARCHIVE_FINISH
"<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
set(CMAKE_CXX_ARCHIVE_FINISH
"<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
else()
add_compile_options(
-ffunction-sections
Expand Down

0 comments on commit c6cf16a

Please sign in to comment.