Skip to content

Commit

Permalink
Added DEP_SODIUM_INCLUDE & DEP_SODIUM_LIB cargo env var
Browse files Browse the repository at this point in the history
Add README to libsodium-sys
Added testcrate for libsodium
Fix CI to test all crates
Add windows support
Added RUST_BACKTRACE to appveyor
Use sodium.h from the source_dir
  • Loading branch information
jean-airoldie committed Jul 4, 2019
1 parent 46cdc31 commit 39df6b8
Show file tree
Hide file tree
Showing 11 changed files with 279 additions and 140 deletions.
12 changes: 7 additions & 5 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,25 @@ environment:
# stable x86_64 with static libsodium from sources
- TARGET: x86_64-pc-windows-msvc
RUST_CHANNEL: stable
RUST_BACKTRACE: 1

# stable x86 with static libsodium from sources
- TARGET: i686-pc-windows-msvc
RUST_CHANNEL: stable
RUST_BACKTRACE: 1

# stable x86_64 with static libsodium from sources
- TARGET: x86_64-pc-windows-gnu
RUST_CHANNEL: stable
RUST_BACKTRACE: 1

# stable x86_64 with dynamic libsodium from vcpkg
- TARGET: x86_64-pc-windows-msvc
RUST_CHANNEL: stable
VCPKG_TARGET: x64-windows
SODIUM_USE_PKG_CONFIG: 1
VCPKGRS_DYNAMIC: 1
RUST_BACKTRACE: 1

install:
- ps: |
Expand All @@ -39,10 +43,8 @@ cache:
- C:\Users\appveyor\.cargo\registry
- target

build_script:
- cmd: cargo build --target %TARGET%
- cmd: cargo build --release --target %TARGET%
build: false

test_script:
- cmd: cargo test --target %TARGET%
- cmd: cargo test --release --target %TARGET%
- cargo test --target %TARGET%
- cargo test --release --target %TARGET%
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ matrix:

script:
- cargo build --verbose
- cargo test --verbose
- cargo test --verbose --all
- cargo test --verbose --no-default-features --features std
- cargo doc

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ exclude = [
]

[workspace]
members = ["libsodium-sys"]
members = ["libsodium-sys", "testcrate"]

[badges]
travis-ci = { repository = "sodiumoxide/sodiumoxide" }
Expand Down
30 changes: 30 additions & 0 deletions libsodium-sys/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#### IDEs ####
### CLion ###
# CMake
cmake-build-debug/

### IntelliJ ###
.idea
*.iws
*.iml
*.ipr

### Vim ###
.sw[a-p]
.*.sw[a-p]
Session.vim
.netrwhist
*~

### Visual Studio Code ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history

#### Languages ####
### Rust ###
/target/
Cargo.lock
4 changes: 2 additions & 2 deletions libsodium-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ travis-ci = { repository = "sodiumoxide/sodiumoxide" }

[build-dependencies]
pkg-config = "0.3"
tar = "0.4"
libflate = "0.1"

[target.'cfg(target_env = "msvc")'.build-dependencies]
libc = { version = "0.2" , default-features = false }
vcpkg = "0.2"

[target.'cfg(not(target_env = "msvc"))'.build-dependencies]
cc = "1.0"
libflate = "0.1"
tar = "0.4"

[dependencies]
libc = { version = "0.2" , default-features = false }
Expand Down
12 changes: 12 additions & 0 deletions libsodium-sys/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
> libsodium-sys
# Build output ENV Variables
This is the possible build metadata for the crate.
* `DEP_SODIUM_INCLUDE` is the directory which contains the `sodium.h` header.
It is only available if the header was installed and `SODIUM_LIB_DIR` was not set.
* `DEP_SODIUM_LIB` is the directory containing the compiled library.
It is only available if `SODIUM_LIB_DIR` was not set.

See [`link build metadata`] for more information about build metadata.

[`link build metadata`]: https://doc.rust-lang.org/cargo/reference/build-scripts.html#the-links-manifest-key
Loading

0 comments on commit 39df6b8

Please sign in to comment.