Skip to content

Commit

Permalink
build .so files on-the-fly
Browse files Browse the repository at this point in the history
  • Loading branch information
colinlyguo committed May 7, 2024
1 parent 665489b commit d4dbe7c
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
*.exe
*.exe~
*.dll
*.a
*.so
*.dylib

# Test binary, built with `go test -c`
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ run: build
docker run -it --rm -v "$(PWD):/workspace" -w /workspace my-dev-container

test:
go test -v -race -gcflags="-l" -ldflags="-s=false" -coverprofile=coverage.txt -covermode=atomic ./...
./run_test
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ Follow these steps to build the `.so` file:

3. Build libzstd:
```
export CARGO_NET_GIT_FETCH_WITH_CLI=false
make libzstd
```

Expand Down
Binary file removed libzstd/libscroll_zstd.so
Binary file not shown.
Binary file removed libzstd/libzktrie.so
Binary file not shown.
15 changes: 15 additions & 0 deletions run_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

# Save the root directory of the project
ROOT_DIR=$(pwd)

# Set the environment variable
export LD_LIBRARY_PATH=$ROOT_DIR/libzstd:$LD_LIBRARY_PATH

# Compile libzstd
cd $ROOT_DIR/libzstd
make libzstd

# Run module tests
cd $ROOT_DIR
env GO111MODULE=on go test -v -race -gcflags="-l" -ldflags="-s=false" -coverprofile=coverage.txt -covermode=atomic ./...

0 comments on commit d4dbe7c

Please sign in to comment.