Skip to content

Commit

Permalink
Fix c,cpp,no-std binding examples (#272)
Browse files Browse the repository at this point in the history
- Use regorus_ffi in target_link_libraries instead of regorus-ffi.
  Something seems to have changed in corrosion-rs to need this.
- Workaround for cmake issue where FFI header may not be generated in time

Signed-off-by: Anand Krishnamoorthi <[email protected]>
  • Loading branch information
anakrish authored Jun 19, 2024
1 parent 46e28b3 commit 4a2a724
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/test-c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ jobs:
- name: Setup gcc, g++, cmake, ninja
run: sudo apt update && sudo apt install -y gcc g++ cmake ninja-build

- name: Workaround to ensure that regorus.h is generated
run: |
cargo build -r
working-directory: ./bindings/ffi

- name: Test c binding
run: |
mkdir bindings/c/build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-ffi.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: bindings/c-cpp
name: bindings/ffi

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion bindings/c-nostd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ corrosion_import_crate(
add_executable(regorus_test main.c)
# Add path to <regorus-source-folder>/bindings/ffi
target_include_directories(regorus_test PRIVATE "../ffi")
target_link_libraries(regorus_test regorus-ffi)
target_link_libraries(regorus_test regorus_ffi)
2 changes: 1 addition & 1 deletion bindings/c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ corrosion_import_crate(
add_executable(regorus_test main.c)
# Add path to <regorus-source-folder>/bindings/ffi
target_include_directories(regorus_test PRIVATE "../ffi")
target_link_libraries(regorus_test regorus-ffi)
target_link_libraries(regorus_test regorus_ffi)
2 changes: 1 addition & 1 deletion bindings/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ corrosion_import_crate(
add_executable(regorus_test main.cpp)
# Add path to <regorus-source-folder>/bindings/ffi
target_include_directories(regorus_test PRIVATE "../ffi")
target_link_libraries(regorus_test regorus-ffi)
target_link_libraries(regorus_test regorus_ffi)

0 comments on commit 4a2a724

Please sign in to comment.