Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic vcpkg. #12859

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "vcpkg"]
path = vcpkg
url = https://github.com/aarlt/vcpkg.git
24 changes: 20 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
cmake_minimum_required(VERSION 3.13.0)

#set(vcpkg "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake")
#if (NOT CMAKE_TOOLCHAIN_FILE)
# if (EXISTS "${vcpkg}")
# set(CMAKE_TOOLCHAIN_FILE "${vcpkg}"
# CACHE FILEPATH "CMake toolchain file")
# else()
# set(CMAKE_TOOLCHAIN_FILE "${CMAKE_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake"
# CACHE FILEPATH "CMake toolchain file")
# endif()
# message(STATUS "vcpkg toolchain found: ${CMAKE_TOOLCHAIN_FILE}")
#endif ()

set(CMAKE_TOOLCHAIN_FILE "${CMAKE_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake"
CACHE FILEPATH "CMake toolchain file")
message(STATUS "vcpkg toolchain found: ${CMAKE_TOOLCHAIN_FILE}")

set(ETH_CMAKE_DIR "${CMAKE_CURRENT_LIST_DIR}/cmake" CACHE PATH "The the path to the cmake directory")
list(APPEND CMAKE_MODULE_PATH ${ETH_CMAKE_DIR})

Expand Down Expand Up @@ -41,10 +57,10 @@ include(EthCcache)

# Let's find our dependencies
include(EthDependencies)
include(fmtlib)
include(jsoncpp)
include(range-v3)
include_directories(SYSTEM ${JSONCPP_INCLUDE_DIR})
find_package(Boost REQUIRED COMPONENTS filesystem system unit_test_framework program_options)
find_package(fmt CONFIG REQUIRED)
find_package(jsoncpp CONFIG REQUIRED)
find_package(range-v3 CONFIG REQUIRED)

find_package(Threads)

Expand Down
8 changes: 0 additions & 8 deletions cmake/FindCLN.cmake

This file was deleted.

33 changes: 0 additions & 33 deletions cmake/FindCVC4.cmake

This file was deleted.

8 changes: 0 additions & 8 deletions cmake/FindGMP.cmake

This file was deleted.

51 changes: 0 additions & 51 deletions cmake/FindZ3.cmake

This file was deleted.

20 changes: 0 additions & 20 deletions cmake/fmtlib.cmake

This file was deleted.

70 changes: 0 additions & 70 deletions cmake/jsoncpp.cmake

This file was deleted.

38 changes: 0 additions & 38 deletions cmake/range-v3.cmake

This file was deleted.

2 changes: 1 addition & 1 deletion libevmasm/Assembly.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ map<u256, u256> const& Assembly::optimiseInternal(
AssemblyItems optimisedItems;

bool usesMSize = ranges::any_of(m_items, [](AssemblyItem const& _i) {
return _i == AssemblyItem{Instruction::MSIZE} || _i.type() == VerbatimBytecode;
return _i == AssemblyItem{Instruction::_MSIZE} || _i.type() == VerbatimBytecode;
});

auto iter = m_items.begin();
Expand Down
4 changes: 2 additions & 2 deletions libevmasm/Instruction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ std::map<std::string, Instruction> const solidity::evmasm::c_instructions =
{ "JUMP", Instruction::JUMP },
{ "JUMPI", Instruction::JUMPI },
{ "PC", Instruction::PC },
{ "MSIZE", Instruction::MSIZE },
{ "MSIZE", Instruction::_MSIZE},
{ "GAS", Instruction::GAS },
{ "JUMPDEST", Instruction::JUMPDEST },
{ "PUSH1", Instruction::PUSH1 },
Expand Down Expand Up @@ -237,7 +237,7 @@ static std::map<Instruction, InstructionInfo> const c_instructionInfo =
{ Instruction::JUMP, { "JUMP", 0, 1, 0, true, Tier::Mid } },
{ Instruction::JUMPI, { "JUMPI", 0, 2, 0, true, Tier::High } },
{ Instruction::PC, { "PC", 0, 0, 1, false, Tier::Base } },
{ Instruction::MSIZE, { "MSIZE", 0, 0, 1, false, Tier::Base } },
{ Instruction::_MSIZE, { "MSIZE", 0, 0, 1, false, Tier::Base } },
{ Instruction::GAS, { "GAS", 0, 0, 1, false, Tier::Base } },
{ Instruction::JUMPDEST, { "JUMPDEST", 0, 0, 0, true, Tier::Special } },
{ Instruction::PUSH1, { "PUSH1", 1, 0, 1, false, Tier::VeryLow } },
Expand Down
2 changes: 1 addition & 1 deletion libevmasm/Instruction.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ enum class Instruction: uint8_t
JUMP, ///< alter the program counter
JUMPI, ///< conditionally alter the program counter
PC, ///< get the program counter
MSIZE, ///< get the size of active memory
_MSIZE, ///< get the size of active memory
GAS, ///< get the amount of available gas
JUMPDEST, ///< set a potential jump destination

Expand Down
10 changes: 5 additions & 5 deletions libevmasm/SemanticInformation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ vector<SemanticInformation::Operation> SemanticInformation::readWriteOperations(
Operation{Location::Storage, Effect::Read, {}, {}, {}},
Operation{Location::Storage, Effect::Write, {}, {}, {}}
};
case Instruction::MSIZE:
case Instruction::_MSIZE:
// This is just to satisfy the assert below.
return vector<Operation>{};
default:
Expand Down Expand Up @@ -176,7 +176,7 @@ bool SemanticInformation::breaksCSEAnalysisBlock(AssemblyItem const& _item, bool
return false;
if (_item.instruction() == Instruction::GAS || _item.instruction() == Instruction::PC)
return true; // GAS and PC assume a specific order of opcodes
if (_item.instruction() == Instruction::MSIZE)
if (_item.instruction() == Instruction::_MSIZE)
return true; // msize is modified already by memory access, avoid that for now
InstructionInfo info = instructionInfo(_item.instruction());
if (_item.instruction() == Instruction::SSTORE)
Expand Down Expand Up @@ -300,7 +300,7 @@ bool SemanticInformation::isDeterministic(AssemblyItem const& _item)
case Instruction::CREATE2:
case Instruction::GAS:
case Instruction::PC:
case Instruction::MSIZE: // depends on previous writes and reads, not only on content
case Instruction::_MSIZE: // depends on previous writes and reads, not only on content
case Instruction::BALANCE: // depends on previous calls
case Instruction::SELFBALANCE: // depends on previous calls
case Instruction::EXTCODESIZE:
Expand Down Expand Up @@ -331,7 +331,7 @@ bool SemanticInformation::movable(Instruction _instruction)
case Instruction::RETURNDATASIZE:
case Instruction::SLOAD:
case Instruction::PC:
case Instruction::MSIZE:
case Instruction::_MSIZE:
case Instruction::GAS:
return false;
default:
Expand Down Expand Up @@ -376,7 +376,7 @@ SemanticInformation::Effect SemanticInformation::memory(Instruction _instruction
case Instruction::CREATE2:
case Instruction::KECCAK256:
case Instruction::MLOAD:
case Instruction::MSIZE:
case Instruction::_MSIZE:
case Instruction::RETURN:
case Instruction::REVERT:
case Instruction::LOG0:
Expand Down
2 changes: 1 addition & 1 deletion libevmasm/SimplificationRule.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ struct EVMBuiltins
static auto constexpr SLOAD = PatternGenerator<Instruction::SLOAD>{};
static auto constexpr SSTORE = PatternGenerator<Instruction::SSTORE>{};
static auto constexpr PC = PatternGenerator<Instruction::PC>{};
static auto constexpr MSIZE = PatternGenerator<Instruction::MSIZE>{};
static auto constexpr MSIZE = PatternGenerator<Instruction::_MSIZE>{};
static auto constexpr GAS = PatternGenerator<Instruction::GAS>{};
static auto constexpr LOG0 = PatternGenerator<Instruction::LOG0>{};
static auto constexpr LOG1 = PatternGenerator<Instruction::LOG1>{};
Expand Down
2 changes: 1 addition & 1 deletion libsolutil/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ set(sources
)

add_library(solutil ${sources})
target_link_libraries(solutil PUBLIC jsoncpp Boost::boost Boost::filesystem Boost::system range-v3)
target_link_libraries(solutil PRIVATE Boost::boost Boost::filesystem Boost::system range-v3 jsoncpp_static)
target_include_directories(solutil PUBLIC "${CMAKE_SOURCE_DIR}")
add_dependencies(solutil solidity_BuildInfo.h)

Expand Down
4 changes: 2 additions & 2 deletions libsolutil/JSON.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
using namespace std;

static_assert(
(JSONCPP_VERSION_MAJOR == 1) && (JSONCPP_VERSION_MINOR == 9) && (JSONCPP_VERSION_PATCH == 3),
"Unexpected jsoncpp version: " JSONCPP_VERSION_STRING ". Expecting 1.9.3."
(JSONCPP_VERSION_MAJOR == 1) && (JSONCPP_VERSION_MINOR == 9) && (JSONCPP_VERSION_PATCH == 5),
"Unexpected jsoncpp version: " JSONCPP_VERSION_STRING ". Expecting 1.9.5."
);

namespace solidity::util
Expand Down
2 changes: 1 addition & 1 deletion libyul/backends/evm/EVMDialect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ pair<YulString, BuiltinFunctionForEVM> createEVMFunction(
f.controlFlowSideEffects.canRevert = false;
}
}
f.isMSize = _instruction == evmasm::Instruction::MSIZE;
f.isMSize = _instruction == evmasm::Instruction::_MSIZE;
f.literalArguments.clear();
f.instruction = _instruction;
f.generateCode = [_instruction](
Expand Down
Loading