Skip to content

Commit

Permalink
Use CMake to configure solidity
Browse files Browse the repository at this point in the history
  • Loading branch information
axic committed Jan 16, 2019
1 parent 6cde749 commit 19db9d2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ keywords = ["ethereum", "solidity"]

[build-dependencies]
bindgen = "0.40.0"
cmake = "0.1"
12 changes: 9 additions & 3 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
extern crate bindgen;
extern crate cmake;

use cmake::Config;

use std::env;
use std::path::PathBuf;

fn main() {
// Tell cargo to tell rustc to link the system bzip2
// shared library.
println!("cargo:rustc-link-lib=solc");
let dst = Config::new("solidity")
.define("TESTS", "OFF")
.define("TOOLS", "OFF")
.build();
println!("cargo:rustc-link-search=native={}/lib", dst.display());
println!("cargo:rustc-link-lib=static=solc");

// The bindgen::Builder is the main entry point
// to bindgen, and lets you build up options for
Expand Down

0 comments on commit 19db9d2

Please sign in to comment.