@@ -26,47 +26,6 @@ fn get_library_build_dir() -> std::io::Result<PathBuf> {
2626 ) )
2727}
2828
29- fn get_cadical_build_dir ( ) -> std:: io:: Result < PathBuf > {
30- let env_var_fetch_result = get_build_directory ( ) ;
31- if let Ok ( build_dir) = env_var_fetch_result {
32- let mut path = PathBuf :: new ( ) ;
33- path. push ( build_dir) ;
34- path. push ( "cadical-src/build/" ) ;
35- return Ok ( path) ;
36- }
37- Err ( Error :: new (
38- ErrorKind :: Other ,
39- "failed to get build output directory" ,
40- ) )
41- }
42-
43- fn get_sat_libraries ( ) -> std:: io:: Result < Vec < & ' static str > > {
44- let env_var_name = "SAT_IMPL" ;
45- let env_var_fetch_result = env:: var ( env_var_name) ;
46- if let Ok ( sat_impls) = env_var_fetch_result {
47- let mut solver_libs = Vec :: new ( ) ;
48- for sat_impl in sat_impls. split ( " " ) {
49- let solver_lib = match sat_impl {
50- "minisat2" => "minisat2-condensed" ,
51- "glucose" => "glucose-condensed" ,
52- "cadical" => "cadical" ,
53- _ => {
54- return Err ( Error :: new (
55- ErrorKind :: Other ,
56- "no identifiable solver detected" ,
57- ) )
58- }
59- } ;
60- solver_libs. push ( solver_lib) ;
61- }
62- return Ok ( solver_libs) ;
63- }
64- Err ( Error :: new (
65- ErrorKind :: Other ,
66- "SAT_IMPL environment variable not set" ,
67- ) )
68- }
69-
7029fn main ( ) {
7130 let cbmc_source_path = Path :: new ( ".." ) ;
7231 let cpp_api_path = Path :: new ( "../libcprover-cpp/" ) ;
@@ -86,27 +45,6 @@ fn main() {
8645 Err ( err) => panic ! ( "Error: {}" , err) ,
8746 } ;
8847
89- let solver_libs = match get_sat_libraries ( ) {
90- Ok ( solvers) => solvers,
91- Err ( err) => panic ! ( "Error: {}" , err) ,
92- } ;
93-
94- for solver_lib in solver_libs. iter ( ) {
95- // Cadical is being built in its own directory, with the resultant artefacts being
96- // present only there. Hence, we need to instruct cargo to look for them in cadical's
97- // build directory, otherwise we're going to get build errors.
98- if * solver_lib == "cadical" {
99- let cadical_build_dir = match get_cadical_build_dir ( ) {
100- Ok ( cadical_directory) => cadical_directory,
101- Err ( err) => panic ! ( "Error: {}" , err) ,
102- } ;
103- println ! (
104- "cargo:rustc-link-search=native={}" ,
105- cadical_build_dir. display( )
106- ) ;
107- }
108- }
109-
11048 println ! (
11149 "cargo:rustc-link-search=native={}" ,
11250 libraries_path. display( )
0 commit comments