From ce39e6e92c27dd59290be18a12ed4cd4c40c01a7 Mon Sep 17 00:00:00 2001 From: "Hoang M. Le" Date: Thu, 5 Oct 2017 12:05:26 +0200 Subject: [cmake] detect available metaSMT backends using a pre-defined flag and raise compile flags accordingly --- lib/Solver/MetaSMTSolver.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'lib/Solver') diff --git a/lib/Solver/MetaSMTSolver.cpp b/lib/Solver/MetaSMTSolver.cpp index 9003b119..695c408b 100644 --- a/lib/Solver/MetaSMTSolver.cpp +++ b/lib/Solver/MetaSMTSolver.cpp @@ -21,11 +21,24 @@ #include "llvm/Support/ErrorHandling.h" #include + +#ifdef METASMT_HAVE_Z3 #include +#endif + +#ifdef METASMT_HAVE_BTOR #include +#endif + +#ifdef METASMT_HAVE_CVC4 #include +#endif + +#ifdef METASMT_HAVE_YICES2 #include +#endif +#ifdef METASMT_HAVE_STP #define Expr VCExpr #define Type VCType #define STP STP_Backend @@ -35,6 +48,7 @@ #undef Type #undef STP #undef type_t +#endif #include #include @@ -415,31 +429,41 @@ Solver *createMetaSMTSolver() { Solver *coreSolver = NULL; std::string backend; switch (MetaSMTBackend) { +#ifdef METASMT_HAVE_STP case METASMT_BACKEND_STP: backend = "STP"; coreSolver = new MetaSMTSolver >( UseForkedCoreSolver, CoreSolverOptimizeDivides); break; +#endif +#ifdef METASMT_HAVE_Z3 case METASMT_BACKEND_Z3: backend = "Z3"; coreSolver = new MetaSMTSolver >( UseForkedCoreSolver, CoreSolverOptimizeDivides); break; +#endif +#ifdef METASMT_HAVE_BTOR case METASMT_BACKEND_BOOLECTOR: backend = "Boolector"; coreSolver = new MetaSMTSolver >( UseForkedCoreSolver, CoreSolverOptimizeDivides); break; +#endif +#ifdef METASMT_HAVE_CVC4 case METASMT_BACKEND_CVC4: backend = "CVC4"; coreSolver = new MetaSMTSolver >( UseForkedCoreSolver, CoreSolverOptimizeDivides); break; +#endif +#ifdef METASMT_HAVE_YICES2 case METASMT_BACKEND_YICES2: backend = "Yices2"; coreSolver = new MetaSMTSolver >( UseForkedCoreSolver, CoreSolverOptimizeDivides); break; +#endif default: llvm_unreachable("Unrecognised MetaSMT backend"); break; -- cgit 1.4.1