From c76034da001bbe882f8db450b70ad865a43fd200 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Thu, 14 Mar 2019 01:45:37 +0100 Subject: [PATCH 1/4] CMake: Upgrade Hunter to v0.23.131 --- cmake/HunterConfig.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/HunterConfig.cmake b/cmake/HunterConfig.cmake index 766ba9d818..4ffe88393d 100644 --- a/cmake/HunterConfig.cmake +++ b/cmake/HunterConfig.cmake @@ -6,6 +6,6 @@ # Hunter is going to be initialized only if building with tests, # where it is needed to get dependencies. HunterGate( - URL "https://github.com/ruslo/hunter/archive/v0.23.4.tar.gz" - SHA1 "8b2255921208517a55c9533c500131387e3c3dd0" + URL "https://github.com/ruslo/hunter/archive/v0.23.131.tar.gz" + SHA1 "0512ea6392065c8ece808296fddd7d8664d30920" ) From 3ef9c1de5076cba3e8c03ab42a0910bb40ffa502 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Thu, 14 Mar 2019 02:55:16 +0100 Subject: [PATCH 2/4] examples: Always build example_vm as shared library --- examples/CMakeLists.txt | 10 +++++++--- test/unittests/CMakeLists.txt | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 3f0c90ba42..4c83937ed6 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,6 +1,6 @@ # EVMC: Ethereum Client-VM Connector API. -# Copyright 2018 The EVMC Authors. -# Licensed under the Apache License, Version 2.0. See the LICENSE file. +# Copyright 2019 The EVMC Authors. +# Licensed under the Apache License, Version 2.0. include(GNUInstallDirs) @@ -15,8 +15,12 @@ add_library(evmc-example-host STATIC example_host.cpp) target_link_libraries(evmc-example-host PRIVATE evmc) -add_library(evmc-example-vm example_vm.c) +add_library(evmc-example-vm SHARED example_vm.c) target_link_libraries(evmc-example-vm PRIVATE evmc) + +add_library(evmc-example-vm-static STATIC example_vm.c) +target_link_libraries(evmc-example-vm-static PRIVATE evmc) + set_source_files_properties(example_vm.c PROPERTIES COMPILE_DEFINITIONS PROJECT_VERSION=${PROJECT_VERSION}) diff --git a/test/unittests/CMakeLists.txt b/test/unittests/CMakeLists.txt index 2f7a0b2bf2..76dce8f32e 100644 --- a/test/unittests/CMakeLists.txt +++ b/test/unittests/CMakeLists.txt @@ -15,5 +15,5 @@ add_executable( test_loader.cpp ) -target_link_libraries(evmc-test PRIVATE loader-mocked evmc-example-vm instructions GTest::gtest GTest::main) +target_link_libraries(evmc-test PRIVATE loader-mocked evmc-example-vm-static instructions GTest::gtest GTest::main) set_target_properties(evmc-test PROPERTIES RUNTIME_OUTPUT_DIRECTORY ..) From 89fcb6f37be9de75629886f47340d02fa263a224 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Thu, 14 Mar 2019 01:37:03 +0100 Subject: [PATCH 3/4] Travis CI: Add configuration for C++ / Windows --- .travis.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000..04d8dc2288 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,24 @@ +branches: + only: + - master + - /^release\/.*$/ + - travis + +matrix: + include: + - language: cpp + os: windows + +cache: + directories: + - C:/Users/travis/.hunter/_Base/Cache + +install: + - cmake --version + - mkdir build && cd build + - cmake .. -G "Visual Studio 15 2017 Win64" -DEVMC_TESTING=ON -DCMAKE_INSTALL_PREFIX=$HOME + - cmake --build . --config Release --target install + +script: + - test/Release/evmc-test.exe + - $HOME/bin/evmc-vmtester.exe $HOME/bin/evmc-example-vm.dll From c0615047a33c0f19007a8dcf9a526fab5fadf13e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Thu, 14 Mar 2019 18:02:41 +0100 Subject: [PATCH 4/4] CI: Remove redundant BUILD_SHARED_LIBS=ON --- appveyor.yml | 2 +- circle.yml | 2 +- lib/instructions/CMakeLists.txt | 7 ++----- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index c94014efdc..6a35abf4d1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -24,7 +24,7 @@ before_build: if ($env:GENERATOR) { if (!(test-path build)) { mkdir build } cd build - cmake -Wno-dev -G "$env:GENERATOR" .. -DBUILD_SHARED_LIBS=ON -DEVMC_TESTING=ON -DCMAKE_INSTALL_PREFIX=C:\install + cmake -Wno-dev -G "$env:GENERATOR" .. -DEVMC_TESTING=ON -DCMAKE_INSTALL_PREFIX=C:\install } build_script: diff --git a/circle.yml b/circle.yml index e3f66b0a8d..603db9900f 100644 --- a/circle.yml +++ b/circle.yml @@ -35,7 +35,7 @@ jobs: - run: name: "Configure" working_directory: ~/build - command: cmake ../project -DCMAKE_INSTALL_PREFIX=~/install -DBUILD_SHARED_LIBS=ON -DEVMC_TESTING=ON $CMAKE_OPTIONS + command: cmake ../project -DCMAKE_INSTALL_PREFIX=~/install -DEVMC_TESTING=ON $CMAKE_OPTIONS - run: name: "Build" command: cmake --build ~/build diff --git a/lib/instructions/CMakeLists.txt b/lib/instructions/CMakeLists.txt index 2c75c15df6..3c639cd538 100644 --- a/lib/instructions/CMakeLists.txt +++ b/lib/instructions/CMakeLists.txt @@ -1,6 +1,6 @@ # EVMC: Ethereum Client-VM Connector API. -# Copyright 2018 The EVMC Authors. -# Licensed under the Apache License, Version 2.0. See the LICENSE file. +# Copyright 2019 The EVMC Authors. +# Licensed under the Apache License, Version 2.0. add_library( instructions STATIC @@ -12,8 +12,5 @@ add_library( add_library(evmc::instructions ALIAS instructions) set_target_properties(instructions PROPERTIES OUTPUT_NAME evmc-instructions) target_include_directories(instructions PUBLIC $$) -if(BUILD_SHARED_LIBS) - set_target_properties(instructions PROPERTIES POSITION_INDEPENDENT_CODE TRUE) -endif() install(TARGETS instructions EXPORT evmcTargets DESTINATION ${CMAKE_INSTALL_LIBDIR})