forked from assimp/assimp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.rs
47 lines (39 loc) · 1.28 KB
/
build.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
extern crate cmake;
use cmake::Config;
macro_rules! options {
($config:ident, $($opt:tt = $value:tt,)*) => {
$( $config.define(stringify!($opt), stringify!($value)); )*
}
}
fn main() {
let mut config = Config::new(".");
options!(config,
BUILD_SHARED_LIBS = OFF,
ASSIMP_OPT_BUILD_PACKAGES = OFF,
ASSIMP_ANDROID_JNIIOSYSTEM = OFF,
ASSIMP_NO_EXPORT = OFF,
ASSIMP_BUILD_ZLIB = OFF,
ASSIMP_BUILD_ASSIMP_TOOLS = OFF,
ASSIMP_BUILD_ASSIMP_VIEW = OFF,
ASSIMP_BUILD_SAMPLES = OFF,
ASSIMP_BUILD_TESTS = OFF,
ASSIMP_COVERALLS = OFF,
SYSTEM_IRRXML = OFF,
BUILD_DOCS = OFF,
ASSIMP_DOUBLE_PRECISION = OFF,
ASSIMP_INSTALL_PDB = OFF,
);
if cfg!(feature = "double_precision") {
options!(config,
ASSIMP_DOUBLE_PRECISION = ON,
);
}
if cfg!(debug_assertions) {
options!(config,
ASSIMP_INSTALL_PDB = ON,
);
}
let dst = config.build_target("assimp").build();
println!("cargo:rustc-link-search=native={}", dst.join("lib").display());
println!("cargo:rustc-link-lib=dylib=assimp");
}