Skip to content

Commit 18ac0ec

Browse files
authored
[ci][fix]use libc++ when compile with clang (#483)
1 parent 9fd6b9a commit 18ac0ec

File tree

4 files changed

+24
-6
lines changed

4 files changed

+24
-6
lines changed

.github/workflows/bazel.yml

+8-2
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,16 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v2
1616

17+
- name: Install newer Clang
18+
run: |
19+
wget https://apt.llvm.org/llvm.sh
20+
chmod +x ./llvm.sh
21+
sudo ./llvm.sh 17
22+
1723
- name: Build
1824
working-directory: ${{github.workspace}}
19-
run: bazel build --action_env=CXX=clang++ --action_env=CC=clang ...
25+
run: bazel build --action_env=CXX=clang++-17 --action_env=CC=clang-17 ...
2026

2127
- name: Test
2228
working-directory: ${{github.workspace}}
23-
run: bazel test --action_env=CXX=clang++ --action_env=CC=clang --test_output=errors ...
29+
run: bazel test --action_env=CXX=clang++-17 --action_env=CC=clang-17 --test_output=errors ...

.github/workflows/ubuntu_clang.yml

+14-2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ jobs:
3131
- name: Install ninja-build tool
3232
uses: seanmiddleditch/gha-setup-ninja@master
3333

34+
- name: Install newer Clang
35+
run: |
36+
wget https://apt.llvm.org/llvm.sh
37+
chmod +x ./llvm.sh
38+
sudo ./llvm.sh 17
39+
3440
- name: ccache
3541
uses: hendrikmuhs/[email protected]
3642
with:
@@ -40,7 +46,7 @@ jobs:
4046
run: |
4147
cmake -B ${{github.workspace}}/build -G Ninja \
4248
-DCMAKE_BUILD_TYPE=${{matrix.mode}} -DBUILD_WITH_LIBCXX=${{matrix.libcxx}} -DENABLE_SSL=${{matrix.ssl}} \
43-
-DUSE_CCACHE=${{env.ccache}} -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
49+
-DUSE_CCACHE=${{env.ccache}} -DCMAKE_C_COMPILER=clang-17 -DCMAKE_CXX_COMPILER=clang++-17
4450
- name: Build
4551
run: cmake --build ${{github.workspace}}/build --config ${{matrix.mode}}
4652

@@ -69,6 +75,12 @@ jobs:
6975
- name: Install ninja-build tool
7076
uses: seanmiddleditch/gha-setup-ninja@v3
7177

78+
- name: Install newer Clang
79+
run: |
80+
wget https://apt.llvm.org/llvm.sh
81+
chmod +x ./llvm.sh
82+
sudo ./llvm.sh 17
83+
7284
- name: Check protoc
7385
run: protoc --version
7486

@@ -81,7 +93,7 @@ jobs:
8193
CXX=clang++ CC=clang
8294
cmake -B ${{github.workspace}}/build -G Ninja \
8395
-DCMAKE_BUILD_TYPE=${{matrix.mode}} -DBUILD_WITH_LIBCXX=${{matrix.libcxx}} -DENABLE_SSL=${{matrix.ssl}} \
84-
-DUSE_CCACHE=${{env.ccache}} -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++\
96+
-DUSE_CCACHE=${{env.ccache}} -DCMAKE_C_COMPILER=clang-17 -DCMAKE_CXX_COMPILER=clang++-17\
8597
-DBUILD_CORO_HTTP=OFF -DBUILD_CORO_IO=OFF -DBUILD_CORO_RPC=OFF -DBUILD_EASYLOG=OFF -DBUILD_STRUCT_JSON=OFF -DBUILD_STRUCT_XML=OFF -DBUILD_STRUCT_YAML=OFF -DBUILD_UTIL=OFF
8698
- name: Build
8799
run: cmake --build ${{github.workspace}}/build --config ${{matrix.mode}}

src/struct_pb/conformance/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/output/tests/struct_pb)
22
find_package(Protobuf QUIET)
33
if (NOT Protobuf_FOUND)
4-
message(WARNING "to build struct_pb conformance test, you must install libprotoc first!!!")
4+
message(STATUS "to build struct_pb conformance test, you need to install libprotoc first")
55
return()
66
endif ()
77
set(CMAKE_INCLUDE_CURRENT_DIR ON)

src/struct_pb/protoc-plugin/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ if (Protobuf_FOUND)
1111
RUNTIME DESTINATION bin
1212
)
1313
else ()
14-
message(WARNING "struct_pb is skipped. To build struct_pb protoc plugin, you must install libprotoc first!!!\n"
14+
message(STATUS "struct_pb is skipped. To build struct_pb protoc plugin, you need to install libprotoc first\n"
1515
"see https://alibaba.github.io/yalantinglibs/en/struct_pb/struct_pb_generating_your_struct.html"
1616
)
1717
endif ()

0 commit comments

Comments
 (0)