Skip to content

Commit f79e35c

Browse files
mkruskal-googlecopybara-github
authored andcommitted
Fix declared dependencies for pkg-config (protocolbuffers#12518)
Closes protocolbuffers#12439 Closes protocolbuffers#12518 PiperOrigin-RevId: 526689125
1 parent 0ecb729 commit f79e35c

File tree

7 files changed

+37
-2
lines changed

7 files changed

+37
-2
lines changed

cmake/install.cmake

+9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
include(GNUInstallDirs)
22

3+
foreach(_target IN LISTS protobuf_ABSL_USED_TARGETS)
4+
string(REPLACE :: _ _modified_target ${_target})
5+
list(APPEND _pc_targets ${_modified_target})
6+
endforeach()
7+
list(APPEND _pc_targets "utf8_range")
8+
9+
string(JOIN " " _pc_target_list ${_pc_targets})
10+
set(_protobuf_PC_REQUIRES ${_pc_target_list})
11+
312
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/protobuf.pc.cmake
413
${CMAKE_CURRENT_BINARY_DIR}/protobuf.pc @ONLY)
514
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/protobuf-lite.pc.cmake

cmake/protobuf-lite.pc.cmake

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
66
Name: Protocol Buffers
77
Description: Google's Data Interchange Format
88
Version: @protobuf_VERSION@
9+
Requires: @_protobuf_PC_REQUIRES@
910
Libs: -L${libdir} -lprotobuf-lite @CMAKE_THREAD_LIBS_INIT@
1011
Cflags: -I${includedir}
1112
Conflicts: protobuf

cmake/protobuf.pc.cmake

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
66
Name: Protocol Buffers
77
Description: Google's Data Interchange Format
88
Version: @protobuf_VERSION@
9+
Requires: @_protobuf_PC_REQUIRES@
910
Libs: -L${libdir} -lprotobuf @CMAKE_THREAD_LIBS_INIT@
1011
Cflags: -I${includedir}
1112
Conflicts: protobuf-lite

third_party/utf8_range/.github/workflows/bazel_tests.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,15 @@ jobs:
2929

3030
steps:
3131
- uses: actions/checkout@v2
32+
- name: Setup Bazel
33+
run: |
34+
echo "BAZEL=bazel" >> $GITHUB_ENV
35+
echo "USE_BAZEL_VERSION=5.1.1" >> $GITHUB_ENV
36+
- name: Setup Bazel (macOS)
37+
if: runner.os == 'macOS'
38+
run: echo "BAZEL=bazelisk" >> $GITHUB_ENV
3239
- name: Install dependencies
3340
run: sudo apt update && sudo apt install -y ${{ matrix.install }}
3441
if: matrix.install != ''
3542
- name: Run tests
36-
run: cd ${{ github.workspace }} && CC=${{ matrix.CC }} bazel test --test_output=errors ... ${{ matrix.flags }}
43+
run: cd ${{ github.workspace }} && CC=${{ matrix.CC }} ${{ env.BAZEL }} test --test_output=errors ... ${{ matrix.flags }}

third_party/utf8_range/CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ if (utf8_range_ENABLE_INSTALL)
7373
install(FILES "${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config.cmake"
7474
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
7575
)
76+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/utf8_range.pc.cmake
77+
${CMAKE_CURRENT_BINARY_DIR}/utf8_range.pc @ONLY)
78+
install(
79+
FILES ${CMAKE_CURRENT_BINARY_DIR}/utf8_range.pc
80+
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
7681

7782
# Install public headers explicitly.
7883
install(FILES utf8_range.h utf8_validity.h
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
prefix=@CMAKE_INSTALL_PREFIX@
2+
exec_prefix=@CMAKE_INSTALL_PREFIX@
3+
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
4+
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
5+
6+
Name: UTF8 Range
7+
Description: Google's UTF8 Library
8+
Version: 1.0
9+
Requires: absl_strings
10+
Libs: -L${libdir} -lprotobuf-lite @CMAKE_THREAD_LIBS_INIT@
11+
Cflags: -I${includedir}
12+
Conflicts: protobuf

update_subtrees.sh

100644100755
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /bin/bash -eux
1+
#!/bin/bash -eux
22

33
set -eux
44

0 commit comments

Comments
 (0)