Skip to content

Commit

Permalink
Avoid using string(JOIN..., which requires cmake 3.12
Browse files Browse the repository at this point in the history
This also downgrades our tests to use cmake 3.10, compatible with our support window.

Closes #12672

PiperOrigin-RevId: 529751568
  • Loading branch information
mkruskal-google authored and copybara-github committed May 5, 2023
1 parent 0ae3289 commit e8f81c3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/test_cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ jobs:
- name: Run tests
uses: protocolbuffers/protobuf-ci/docker@v1
with:
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/cmake@sha256:7058879cac0224e443043eae2de82c13a63a54dd31855dac020c5522aa573cd2
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/cmake:3.10.3-024d317d8409d877a9e883319685c525d1190ba2
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
command: >-
/test.sh ${{ matrix.flags}} ${{ env.CCACHE_CMAKE_FLAGS }}
Expand All @@ -142,7 +142,7 @@ jobs:
- name: Run tests
uses: protocolbuffers/protobuf-ci/docker@v1
with:
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/cmake@sha256:7058879cac0224e443043eae2de82c13a63a54dd31855dac020c5522aa573cd2
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/cmake:3.10.3-024d317d8409d877a9e883319685c525d1190ba2
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
command: >-
/install.sh -DCMAKE_CXX_STANDARD=14 ${{ env.CCACHE_CMAKE_FLAGS }} -Dprotobuf_USE_EXTERNAL_GTEST=ON -Dprotobuf_ABSL_PROVIDER=package \&\&
Expand Down Expand Up @@ -171,7 +171,7 @@ jobs:
- name: Run tests
uses: protocolbuffers/protobuf-ci/docker@v1
with:
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/cmake@sha256:7058879cac0224e443043eae2de82c13a63a54dd31855dac020c5522aa573cd2
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/cmake:3.10.3-024d317d8409d877a9e883319685c525d1190ba2
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
command: >-
/install.sh -DCMAKE_CXX_STANDARD=14 ${{ env.CCACHE_CMAKE_FLAGS }}
Expand Down Expand Up @@ -200,7 +200,7 @@ jobs:
- name: Run tests
uses: protocolbuffers/protobuf-ci/docker@v1
with:
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/cmake@sha256:e0eb6c69b7551d89f0dbdbe11906077a1d501229c28db39623b945e0c5d7029a
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/cmake:3.10.3-024d317d8409d877a9e883319685c525d1190ba2
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
command: >-
/test.sh ${{ env.CCACHE_CMAKE_FLAGS }}
Expand Down
8 changes: 6 additions & 2 deletions cmake/install.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ foreach(_target IN LISTS protobuf_ABSL_USED_TARGETS)
endforeach()
list(APPEND _pc_targets "utf8_range")

string(JOIN " " _pc_target_list ${_pc_targets})
set(_protobuf_PC_REQUIRES ${_pc_target_list})
set(_protobuf_PC_REQUIRES "")
set(_sep "")
foreach (_target IN LISTS _pc_target_list)
string(CONCAT _protobuf_PC_REQUIRES "${_protobuf_PC_REQUIRES}" "${_sep}" "${_target}")
set(_sep " ")
endforeach ()

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/protobuf.pc.cmake
${CMAKE_CURRENT_BINARY_DIR}/protobuf.pc @ONLY)
Expand Down

0 comments on commit e8f81c3

Please sign in to comment.