Skip to content

Commit

Permalink
server: make protobuf-c into a git submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
doronz88 committed Dec 21, 2023
1 parent 83c19e7 commit a99f3bb
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 17 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:

steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
Expand Down Expand Up @@ -74,6 +76,8 @@ jobs:

steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Run clang-format style.
run: |
if clang-format -n ../protos/*.proto *.h *.c | grep -q " code should be clang-formatted" ; then
Expand Down Expand Up @@ -140,6 +144,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ jobs:

steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v4
with:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/server-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive

- if: matrix.os == 'ubuntu-latest'
name: Build server on ubuntu
Expand Down
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,5 @@ _CodeSignature
**/_version.py
src/rpcserver/protos/
src/rpcclient/rpcclient/protos/
src/rpcserver/build/
cmake-build-debug

# Third party
src/rpcserver/protobuf-c/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "src/rpcserver/protobuf-c"]
path = src/rpcserver/protobuf-c
url = https://github.com/protobuf-c/protobuf-c.git
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ For macOS/iOS (Ensure that Xcode is installed):
```bash
brew install protobuf protobuf-c
python3 -m pip install mypy-protobuf protobuf grpcio-tools
git clone [email protected]:doronz88/rpc-project.git
git clone [email protected]:doronz88/rpc-project.git --recurse-submodules
cd rpc-project
make -C src/protos/ all
cd src/rpcserver
Expand All @@ -102,7 +102,7 @@ make
```bash
sudo apt-get install -y protobuf-compiler libprotobuf-dev libprotoc-dev protobuf-c-compiler
python3 -m pip mypy-protobuf protobuf grpcio-tools
git clone [email protected]:doronz88/rpc-project.git
git clone [email protected]:doronz88/rpc-project.git --recurse-submodules
cd rpc-project
make -C src/protos/ all
cd src/rpcserver
Expand Down
13 changes: 1 addition & 12 deletions src/rpcserver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,7 @@ endif ()

### Check if protobuf-c source not found and download if necessary
if (NOT EXISTS ${CMAKE_SOURCE_DIR}/protobuf-c)
message(STATUS "protobuf-c not found, downloading...")
ExternalProject_Add(
protobuf-c-download
PREFIX "protobuf-c-download"
GIT_REPOSITORY https://github.com/protobuf-c/protobuf-c.git
GIT_TAG v1.5.0
SOURCE_DIR ${CMAKE_SOURCE_DIR}/protobuf-c/
# Disable all other steps
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
)
message(FATAL " protobuf-c not found, please execute 'git submodule update --init --recursive'")
endif ()
# Build protobuf-c after downloading
set(LIBPROTO_C "${CMAKE_BINARY_DIR}/protobuf-c-build")
Expand Down
1 change: 1 addition & 0 deletions src/rpcserver/protobuf-c
Submodule protobuf-c added at 8c201f

0 comments on commit a99f3bb

Please sign in to comment.