diff --git a/.github/workflows/ci-build.yaml b/.github/workflows/ci-build.yaml index 9428ca0c..082eb0de 100644 --- a/.github/workflows/ci-build.yaml +++ b/.github/workflows/ci-build.yaml @@ -1,6 +1,10 @@ name: CI build -on: [push, pull_request] +on: [push] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true jobs: protolint: @@ -12,3 +16,35 @@ jobs: uses: plexsystems/protolint-action@v0.4.0 with: configDirectory: . + + build-linux: + runs-on: ubuntu-latest + steps: + - name: Checkout source + uses: actions/checkout@v4 + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y libprotobuf-dev protobuf-compiler + - name: Build + run: > + mkdir build + && cd build + && cmake .. + && make all + + build-macos: + runs-on: macos-latest + steps: + - name: Checkout source + uses: actions/checkout@v4 + - name: Install dependencies + run: | + brew update + brew install protobuf + - name: Build + run: > + mkdir build + && cd build + && cmake .. + && make all diff --git a/CMakeLists.txt b/CMakeLists.txt index 0107aefe..2eca60a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,16 @@ include(GNUInstallDirs) find_package(Protobuf REQUIRED) find_package(Python3 COMPONENTS Interpreter REQUIRED) +message(STATUS "Using protobuf ${Protobuf_VERSION}") +message(STATUS "Protobuf libraries: ${Protobuf_LIBRARIES}") + +# We need to link abseil if protobuf version is 6.x or higher +if(Protobuf_VERSION VERSION_GREATER_EQUAL "6.0.0") + message(STATUS "Protobuf version is ${Protobuf_VERSION}, linking abseil") + find_package(absl REQUIRED) + set(Protobuf_LIBRARIES ${Protobuf_LIBRARIES} absl::log absl::strings absl::base absl::status absl::log_internal_check_op absl::log_internal_message) +endif() + file(GLOB ProtoFiles "protobuf_definitions/*.proto") foreach(ProtoFile ${ProtoFiles}) @@ -19,7 +29,7 @@ protobuf_generate_python(PROTO_PY ${ProtoFiles}) add_library(blueyeprotocol SHARED ${ProtoSources} ${ProtoHeaders}) set(EXT_LIBS - ${PROTOBUF_LIBRARIES} + ${Protobuf_LIBRARIES} ) target_link_libraries(blueyeprotocol PUBLIC ${EXT_LIBS})