From 13fa440d37582f80a144b3848340fceb5c55e88d Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Fri, 17 Mar 2017 12:29:57 +0000 Subject: Parse optimizer settings in StandardCompiler --- libsolidity/interface/StandardCompiler.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'libsolidity/interface') diff --git a/libsolidity/interface/StandardCompiler.cpp b/libsolidity/interface/StandardCompiler.cpp index 7f3b7a58..88e3b111 100644 --- a/libsolidity/interface/StandardCompiler.cpp +++ b/libsolidity/interface/StandardCompiler.cpp @@ -43,9 +43,12 @@ Json::Value StandardCompiler::compileInternal(Json::Value const& _input) for (auto const& sourceName: sources.getMemberNames()) m_compilerStack.addSource(sourceName, sources[sourceName]["content"].asString()); - // @TODO parse settings - bool optimize = false; - unsigned optimizeRuns = 200; + Json::Value const& settings = _input.get("settings", Json::Value()); + + Json::Value optimizerSettings = settings.get("optimizer", Json::Value()); + bool optimize = optimizerSettings.get("enabled", Json::Value(false)).asBool(); + unsigned optimizeRuns = optimizerSettings.get("runs", Json::Value(200u)).asUInt(); + map libraries; auto scannerFromSourceName = [&](string const& _sourceName) -> solidity::Scanner const& { return m_compilerStack.scanner(_sourceName); }; -- cgit v1.2.3