Skip to content

Commit

Permalink
chore: remove filesystem clean c bindings (#1062)
Browse files Browse the repository at this point in the history
* chore: remove filesystem clean c bindings

* add env var in actions file
  • Loading branch information
LucioFranco authored Feb 20, 2024
1 parent b9440fb commit 6a6b5df
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/c-bindings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable

# needed because we run out of disk space during tests
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# when set to "true" but frees about 6 GB
tool-cache: true

- name: Install Protoc
uses: arduino/setup-protoc@v2

Expand All @@ -43,6 +35,15 @@ jobs:
- name: Build crates
run: cargo build --release

- name: copy lib
working-directory: bindings/c
run: cp ../../target/release/libsql_experimental.a .

- name: clean rust
run: cargo clean

- name: Build C bindings example
working-directory: bindings/c
env:
LIBSQL_EXPERIMENTAL_PATH: libsql_experimental.a
run: make
5 changes: 4 additions & 1 deletion bindings/c/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ OS := $(shell uname)
CFLAGS := -Iinclude
LDFLAGS := -lm

# Set LIBSQL_PATH to the default path if not provided
LIBSQL_EXPERIMENTAL_PATH ?= ../../target/release/libsql_experimental.a

ifeq ($(OS),Darwin)
CFLAGS += -framework Security -framework CoreServices
endif
Expand All @@ -10,4 +13,4 @@ endif
all: example

example: example.c
$(CC) -o $@ $(CFLAGS) $< ../../target/release/libsql_experimental.a $(LDFLAGS)
$(CC) -o $@ $(CFLAGS) $< $(LIBSQL_EXPERIMENTAL_PATH) $(LDFLAGS)

0 comments on commit 6a6b5df

Please sign in to comment.