-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbuild.rs
91 lines (87 loc) · 4.54 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
fn main()
{
cxx_build::bridge("src/lib.rs")
.file("src/AssociativeContainers.cc")
.file("src/Ciphertext.cc")
.file("src/CryptoContext.cc")
.file("src/CryptoParametersBase.cc")
.file("src/DCRTPoly.cc")
.file("src/DecryptResult.cc")
.file("src/EncodingParams.cc")
.file("src/EvalKey.cc")
.file("src/KeyPair.cc")
.file("src/LWEPrivateKey.cc")
.file("src/Params.cc")
.file("src/Plaintext.cc")
.file("src/PrivateKey.cc")
.file("src/PublicKey.cc")
.file("src/SchemeBase.cc")
.file("src/SequenceContainers.cc")
.file("src/SerialDeserial.cc")
.include("/usr/local/include/openfhe")
.include("/usr/local/include/openfhe/third-party/include")
.include("/usr/local/include/openfhe/core")
.include("/usr/local/include/openfhe/pke")
.include("/usr/local/include/openfhe/binfhe")
.include("./openfhe-development/install/include") // GitHub Actions
.include("./openfhe-development/install/include/openfhe") // GitHub Actions
.include("./openfhe-development/install/include/openfhe/third-party/include") // GitHub Actions
.include("./openfhe-development/install/include/openfhe/core") // GitHub Actions
.include("./openfhe-development/install/include/openfhe/pke") // GitHub Actions
.include("./openfhe-development/install/include/openfhe/binfhe") // GitHub Actions
.flag_if_supported("-std=c++17")
.flag_if_supported("-Wall")
.flag_if_supported("-Werror")
.flag_if_supported("-O3")
.flag_if_supported("-fopenmp") // [-Wunknown-pragmas]
.flag_if_supported("-Wno-parentheses") // [-Wparentheses]
.flag_if_supported("-Wno-unused-parameter") // [-Wunused-parameter]
.flag_if_supported("-Wno-missing-field-initializers") // [-Wmissing-field-initializers]
.flag_if_supported("-Wno-unused-function") // [-Wunused-function]
.compile("openfhe");
println!("cargo::rerun-if-changed=src/lib.rs");
println!("cargo::rerun-if-changed=src/AssociativeContainers.h");
println!("cargo::rerun-if-changed=src/AssociativeContainers.cc");
println!("cargo::rerun-if-changed=src/Ciphertext.h");
println!("cargo::rerun-if-changed=src/Ciphertext.cc");
println!("cargo::rerun-if-changed=src/CryptoContext.h");
println!("cargo::rerun-if-changed=src/CryptoContext.cc");
println!("cargo::rerun-if-changed=src/CryptoParametersBase.h");
println!("cargo::rerun-if-changed=src/CryptoParametersBase.cc");
println!("cargo::rerun-if-changed=src/DCRTPoly.h");
println!("cargo::rerun-if-changed=src/DCRTPoly.cc");
println!("cargo::rerun-if-changed=src/DecryptResult.h");
println!("cargo::rerun-if-changed=src/DecryptResult.cc");
println!("cargo::rerun-if-changed=src/EncodingParams.h");
println!("cargo::rerun-if-changed=src/EncodingParams.cc");
println!("cargo::rerun-if-changed=src/EvalKey.h");
println!("cargo::rerun-if-changed=src/EvalKey.cc");
println!("cargo::rerun-if-changed=src/KeyPair.h");
println!("cargo::rerun-if-changed=src/KeyPair.cc");
println!("cargo::rerun-if-changed=src/LWEPrivateKey.h");
println!("cargo::rerun-if-changed=src/LWEPrivateKey.cc");
println!("cargo::rerun-if-changed=src/Params.h");
println!("cargo::rerun-if-changed=src/Params.cc");
println!("cargo::rerun-if-changed=src/Plaintext.h");
println!("cargo::rerun-if-changed=src/Plaintext.cc");
println!("cargo::rerun-if-changed=src/PrivateKey.h");
println!("cargo::rerun-if-changed=src/PrivateKey.cc");
println!("cargo::rerun-if-changed=src/PublicKey.h");
println!("cargo::rerun-if-changed=src/PublicKey.cc");
println!("cargo::rerun-if-changed=src/SchemeBase.h");
println!("cargo::rerun-if-changed=src/SchemeBase.cc");
println!("cargo::rerun-if-changed=src/SequenceContainers.h");
println!("cargo::rerun-if-changed=src/SequenceContainers.cc");
println!("cargo::rerun-if-changed=src/SerialDeserial.h");
println!("cargo::rerun-if-changed=src/SerialDeserial.cc");
// linking openFHE
println!("cargo::rustc-link-arg=-L/usr/local/lib");
println!("cargo::rustc-link-arg=-L./openfhe-development/install/lib"); // GitHub Actions
println!("cargo::rustc-link-arg=-lOPENFHEpke");
println!("cargo::rustc-link-arg=-lOPENFHEbinfhe");
println!("cargo::rustc-link-arg=-lOPENFHEcore");
// linking OpenMP
println!("cargo::rustc-link-arg=-fopenmp");
// necessary to avoid LD_LIBRARY_PATH
println!("cargo::rustc-link-arg=-Wl,-rpath,/usr/local/lib");
}