Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add C++ SDK #108

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/cpp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: C++

on:
push:
branches:
- main
pull_request:
workflow_dispatch:

jobs:
protogen:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup protobuf compiler
uses: arduino/setup-protoc@v3
with:
version: "26.1"
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup buf
uses: bufbuild/buf-setup-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Regenerate c++ codes from proto files
run: |
buf generate --template buf.gen.cpp.yaml
working-directory: proto

- name: Check updated
run: |
git add -N cpp/src/ommx/ # To check newly generated files
git diff --exit-code
20 changes: 20 additions & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
cmake_minimum_required(VERSION 3.14)

# Set OMMX C++ SDK version
project(ommx VERSION 0.1.0)

# Use C++17
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Protobuf must be required
find_package(Protobuf REQUIRED)

# Create a static library
file(GLOB SRC "src/ommx/v1/*.pb.cc")
add_library(ommx STATIC ${SRC})

target_include_directories(ommx PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>/src
$<INSTALL_INTERFACE:include>
)
1,268 changes: 1,268 additions & 0 deletions cpp/src/ommx/v1/constraint.pb.cc

Large diffs are not rendered by default.

Loading
Loading