2018-10-15 09:52:35 +00:00
|
|
|
# Until we have a clear separation, libyul has to be included here
|
2018-11-23 13:21:17 +00:00
|
|
|
set(sources
|
|
|
|
analysis/ConstantEvaluator.cpp
|
|
|
|
analysis/ControlFlowAnalyzer.cpp
|
|
|
|
analysis/ControlFlowBuilder.cpp
|
|
|
|
analysis/ControlFlowGraph.cpp
|
|
|
|
analysis/DeclarationContainer.cpp
|
|
|
|
analysis/DocStringAnalyser.cpp
|
|
|
|
analysis/GlobalContext.cpp
|
|
|
|
analysis/NameAndTypeResolver.cpp
|
|
|
|
analysis/PostTypeChecker.cpp
|
|
|
|
analysis/ReferencesResolver.cpp
|
|
|
|
analysis/SemVerHandler.cpp
|
|
|
|
analysis/StaticAnalyzer.cpp
|
|
|
|
analysis/SyntaxChecker.cpp
|
|
|
|
analysis/TypeChecker.cpp
|
|
|
|
analysis/ViewPureChecker.cpp
|
|
|
|
ast/AST.cpp
|
|
|
|
ast/ASTAnnotations.cpp
|
|
|
|
ast/ASTJsonConverter.cpp
|
|
|
|
ast/ASTPrinter.cpp
|
|
|
|
ast/Types.cpp
|
|
|
|
codegen/ABIFunctions.cpp
|
|
|
|
codegen/ArrayUtils.cpp
|
|
|
|
codegen/Compiler.cpp
|
|
|
|
codegen/CompilerContext.cpp
|
|
|
|
codegen/CompilerUtils.cpp
|
|
|
|
codegen/ContractCompiler.cpp
|
|
|
|
codegen/ExpressionCompiler.cpp
|
|
|
|
codegen/LValue.cpp
|
|
|
|
formal/SMTChecker.cpp
|
|
|
|
formal/SMTLib2Interface.cpp
|
|
|
|
formal/SMTPortfolio.cpp
|
|
|
|
formal/SSAVariable.cpp
|
|
|
|
formal/SymbolicTypes.cpp
|
|
|
|
formal/SymbolicVariables.cpp
|
|
|
|
formal/VariableUsage.cpp
|
|
|
|
interface/ABI.cpp
|
|
|
|
interface/AssemblyStack.cpp
|
|
|
|
interface/CompilerStack.cpp
|
|
|
|
interface/GasEstimator.cpp
|
|
|
|
interface/Natspec.cpp
|
|
|
|
interface/StandardCompiler.cpp
|
|
|
|
interface/Version.cpp
|
|
|
|
parsing/DocStringParser.cpp
|
|
|
|
parsing/Parser.cpp
|
|
|
|
)
|
2014-10-06 15:13:52 +00:00
|
|
|
|
2017-07-13 19:04:19 +00:00
|
|
|
find_package(Z3 QUIET)
|
|
|
|
if (${Z3_FOUND})
|
|
|
|
include_directories(${Z3_INCLUDE_DIR})
|
|
|
|
add_definitions(-DHAVE_Z3)
|
2018-04-06 16:01:40 +00:00
|
|
|
message("Z3 SMT solver found. This enables optional SMT checking with Z3.")
|
2018-11-23 13:21:17 +00:00
|
|
|
set(z3_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/formal/Z3Interface.cpp")
|
2017-07-13 19:04:19 +00:00
|
|
|
else()
|
2018-11-23 13:21:17 +00:00
|
|
|
set(z3_SRCS)
|
2018-04-20 14:56:10 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
find_package(CVC4 QUIET)
|
|
|
|
if (${CVC4_FOUND})
|
2018-08-08 15:23:15 +00:00
|
|
|
include_directories(${CVC4_INCLUDE_DIR})
|
|
|
|
add_definitions(-DHAVE_CVC4)
|
|
|
|
message("CVC4 SMT solver found. This enables optional SMT checking with CVC4.")
|
2018-11-23 13:21:17 +00:00
|
|
|
set(cvc4_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/formal/CVC4Interface.cpp")
|
2018-04-20 14:56:10 +00:00
|
|
|
else()
|
2018-11-23 13:21:17 +00:00
|
|
|
set(cvc4_SRCS)
|
2018-04-20 14:56:10 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if (NOT (${Z3_FOUND} OR ${CVC4_FOUND}))
|
2018-08-08 14:46:17 +00:00
|
|
|
message("No SMT solver found (or it has been forcefully disabled). Optional SMT checking will not be available.\
|
|
|
|
\nPlease install Z3 or CVC4 or remove the option disabling them (USE_Z3, USE_CVC4).")
|
2017-07-13 19:04:19 +00:00
|
|
|
endif()
|
|
|
|
|
2018-11-23 13:21:17 +00:00
|
|
|
add_library(solidity ${sources} ${z3_SRCS} ${cvc4_SRCS})
|
2018-11-23 10:39:40 +00:00
|
|
|
target_link_libraries(solidity PUBLIC yul evmasm langutil devcore ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY})
|
2017-07-13 19:04:19 +00:00
|
|
|
|
|
|
|
if (${Z3_FOUND})
|
|
|
|
target_link_libraries(solidity PUBLIC ${Z3_LIBRARY})
|
2018-04-06 16:01:40 +00:00
|
|
|
endif()
|
|
|
|
|
2018-08-08 15:23:15 +00:00
|
|
|
if (${CVC4_FOUND})
|
2018-08-08 14:31:17 +00:00
|
|
|
target_link_libraries(solidity PUBLIC ${CVC4_LIBRARIES})
|
2018-04-06 16:01:40 +00:00
|
|
|
endif()
|