Skip to content

Commit

Permalink
Merge branch 'main' into add_metric
Browse files Browse the repository at this point in the history
  • Loading branch information
qicosmos authored Jun 6, 2024
2 parents e63cf15 + 9d29664 commit b89d3fe
Show file tree
Hide file tree
Showing 175 changed files with 15,385 additions and 16,200 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/s390x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
CXX=g++ CC=gcc
cmake -B ${{github.workspace}}/build \
-DCMAKE_BUILD_TYPE=Debug \
-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 -DBUILD_STRUCT_PB=OFF -DBUILD_EXAMPLES=OFF -DBUILD_BENCHMARK=OFF
-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 -DBUILD_EXAMPLES=OFF -DBUILD_BENCHMARK=OFF
cmake --build ${{github.workspace}}/build -j
cd ${{github.workspace}}/build/output/tests
./struct_pack_test
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ubuntu_clang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:
cmake -B ${{github.workspace}}/build -G Ninja \
-DCMAKE_BUILD_TYPE=${{matrix.mode}} -DBUILD_WITH_LIBCXX=${{matrix.libcxx}} -DYLT_ENABLE_SSL=${{matrix.ssl}} \
-DUSE_CCACHE=${{env.ccache}} -DCMAKE_C_COMPILER=clang-17 -DCMAKE_CXX_COMPILER=clang++-17\
-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
-DBUILD_CORO_HTTP=OFF -DBUILD_CORO_IO=OFF -DBUILD_STRUCT_PB=ON -DBUILD_CORO_RPC=OFF -DBUILD_EASYLOG=OFF -DBUILD_STRUCT_JSON=OFF -DBUILD_STRUCT_XML=OFF -DBUILD_STRUCT_YAML=OFF -DBUILD_UTIL=OFF
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{matrix.mode}}

Expand Down Expand Up @@ -146,7 +146,7 @@ jobs:
-DBUILD_WITH_LIBCXX=${{matrix.libcxx}} \
-DYLT_ENABLE_IO_URING=${{matrix.io_uring}} \
-DUSE_CCACHE=${{env.ccache}} -DCMAKE_C_COMPILER=clang-17 -DCMAKE_CXX_COMPILER=clang++-17\
-DBUILD_STRUCT_JSON=OFF -DBUILD_STRUCT_XML=OFF -DBUILD_STRUCT_PACK=OFF -DBUILD_STRUCT_PB=OFF -DBUILD_STRUCT_YAML=OFF -DBUILD_UTIL=OFF
-DBUILD_STRUCT_JSON=OFF -DBUILD_STRUCT_XML=OFF -DBUILD_STRUCT_PACK=OFF -DBUILD_STRUCT_YAML=OFF -DBUILD_UTIL=OFF
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{matrix.mode}}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ubuntu_gcc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
cmake -B ${{github.workspace}}/build -G Ninja \
-DCMAKE_BUILD_TYPE=${{matrix.mode}} -DBUILD_WITH_LIBCXX=${{matrix.libcxx}} -DYLT_ENABLE_SSL=${{matrix.ssl}} \
-DUSE_CCACHE=${{env.ccache}} \
-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
-DBUILD_CORO_HTTP=OFF -DBUILD_CORO_IO=OFF -DBUILD_STRUCT_PB=ON -DBUILD_CORO_RPC=OFF -DBUILD_EASYLOG=OFF -DBUILD_STRUCT_JSON=OFF -DBUILD_STRUCT_XML=OFF -DBUILD_STRUCT_YAML=OFF -DBUILD_UTIL=OFF
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{matrix.mode}}
Expand Down Expand Up @@ -118,7 +118,7 @@ jobs:
-DCMAKE_BUILD_TYPE=${{matrix.mode}} \
-DYLT_ENABLE_IO_URING=${{matrix.io_uring}} \
-DUSE_CCACHE=${{env.ccache}} \
-DBUILD_STRUCT_JSON=OFF -DBUILD_STRUCT_XML=OFF -DBUILD_STRUCT_PACK=OFF -DBUILD_STRUCT_PB=OFF -DBUILD_STRUCT_YAML=OFF -DBUILD_UTIL=OFF
-DBUILD_STRUCT_JSON=OFF -DBUILD_STRUCT_XML=OFF -DBUILD_STRUCT_PACK=OFF -DBUILD_STRUCT_YAML=OFF -DBUILD_UTIL=OFF
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{matrix.mode}}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
with:
key: ${{ github.job }}-${{ matrix.mode}}-arch-${{ matrix.arch}}
- name: Configure CMake
run: cmake -B ${{github.workspace}}\build -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.mode }} -DYLT_ENABLE_SSL=${{matrix.ssl}} -DUSE_CCACHE=ON -DENABLE_CPP_20=OFF
run: cmake -B ${{github.workspace}}\build -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.mode }} -DYLT_ENABLE_SSL=${{matrix.ssl}} -DBUILD_STRUCT_PB=OFF -DUSE_CCACHE=ON -DENABLE_CPP_20=OFF
- name: Build
run: cmake --build ${{github.workspace}}\build
- name: Test
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,6 @@ node_modules
bazel-*
!BUILD.bazel
cdb.json

# website
website/docs/zh/*/images/
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ if(CMAKE_PROJECT_NAME STREQUAL "yaLanTingLibs") # if ylt is top-level project
include_directories(src/include)

include(cmake/utils.cmake)
include(cmake/struct_pb.cmake)
include(cmake/build.cmake)
include(cmake/develop.cmake)
# add project config, such as enable_ssl.
Expand Down
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ void basic_usage() {
coro_http is a C++20 coroutine http(https) library, include server and client, functions: get/post, websocket, multipart file upload, chunked and ranges download etc. [more examples](https://github.com/alibaba/yalantinglibs/blob/main/src/coro_http/examples/example.cpp)

### get/post
```c++
```cpp
#include "ylt/coro_http/coro_http_server.hpp"
#include "ylt/coro_http/coro_http_client.hpp"
using namespace coro_http;
Expand Down Expand Up @@ -379,7 +379,7 @@ int main() {
```
### websocket
```c++
```cpp
async_simple::coro::Lazy<void> websocket(coro_http_client &client) {
// connect to your websocket server.
bool r = co_await client.async_connect("ws://example.com/ws");
Expand All @@ -401,7 +401,7 @@ async_simple::coro::Lazy<void> websocket(coro_http_client &client) {
```

### upload/download
```c++
```cpp
async_simple::coro::Lazy<void> upload_files(coro_http_client &client) {
std::string uri = "http://example.com";

Expand Down Expand Up @@ -504,11 +504,9 @@ No dependency.
No dependency.
### struct_pb (optional)
### struct_pb
In default, struct_pb wont be installed. You need install protobuf manually.
- [protobuf](https://protobuf.dev/)
No dependency.
## Standalone sublibraries
Expand Down
224 changes: 0 additions & 224 deletions cmake/struct_pb.cmake

This file was deleted.

13 changes: 5 additions & 8 deletions cmake/subdir.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ endif()
foreach(child ${children})
get_filename_component(subdir_name ${child} NAME)
string(TOUPPER ${subdir_name} subdir_name)
message(STATUS "BUILD_${subdir_name}: ${BUILD_${subdir_name}}")
endforeach()
if((${subdir_name} STREQUAL "STRUCT_PACK" OR ${subdir_name} STREQUAL "STRUCT_PB") AND (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC"))
message(STATUS "skip ${subdir_name}")
continue()
endif()

foreach(child ${children})
get_filename_component(subdir_name ${child} NAME)
string(TOUPPER ${subdir_name} subdir_name)
if (BUILD_${subdir_name})
message(STATUS "BUILD_${subdir_name}: ${BUILD_${subdir_name}}")
if(BUILD_EXAMPLES AND EXISTS ${child}/examples)
add_subdirectory(${child}/examples)
endif()
Expand All @@ -40,7 +40,4 @@ foreach(child ${children})
endif()
endif()
endforeach()
if (BUILD_STRUCT_PB)
add_subdirectory(src/struct_pb)
endif()
message(STATUS "--------------------------------------------")
Loading

0 comments on commit b89d3fe

Please sign in to comment.