Skip to content

Commit

Permalink
Merge pull request #34 from Shareong/main
Browse files Browse the repository at this point in the history
upgrade log & replace hunter with vcpkg
  • Loading branch information
Shareong authored Mar 13, 2024
2 parents afe8c0f + 1073c65 commit f7c61d5
Show file tree
Hide file tree
Showing 32 changed files with 2,094 additions and 3,350 deletions.
66 changes: 33 additions & 33 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ jobs:
id: cache
with:
path: |
/home/runner/.hunter
/Users/runner/.hunter/
/home/runner/vcpkg
/Users/runner/vcpkg/
ccache
key: hunter-clang-v1-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }}
key: vcpkg-clang-v1-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }}
restore-keys: |
hunter-clang-v1-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }}
hunter-clang-v1-notest-${{ runner.temp }}-${{ github.base_ref }}-
hunter-clang-v1-notest-${{ runner.temp }}-
vcpkg-clang-v1-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }}
vcpkg-clang-v1-notest-${{ runner.temp }}-${{ github.base_ref }}-
vcpkg-clang-v1-notest-${{ runner.temp }}-
- name: install macOS dependencies
if: runner.os == 'macOS'
run: brew install ccache
Expand All @@ -49,7 +49,7 @@ jobs:
run: export SDKROOT=$(xcrun --sdk macosx --show-sdk-path) && CC=/usr/bin/clang CXX=/usr/bin/clang++ cmake . -DTESTS=ON
- name: configure
if: runner.os == 'Linux'
run: CC=/usr/bin/clang CXX=/usr/bin/clang++ cmake . -DTESTS=ON -DHUNTER_CONFIGURATION_TYPES=Debug
run: CC=/usr/bin/clang CXX=/usr/bin/clang++ cmake . -DTESTS=ON
- name: compile
run: make -j2
- name: run test
Expand All @@ -67,12 +67,12 @@ jobs:
- uses: actions/cache@v2
id: cache
with:
path: /home/runner/.hunter
key: hunter-gcc-v1-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }}
path: /home/runner/vcpkg
key: vcpkg-gcc-v1-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }}
restore-keys: |
hunter-gcc-v1-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }}
hunter-gcc-v1-notest-${{ runner.temp }}-${{ github.base_ref }}-
hunter-gcc-v1-notest-${{ runner.temp }}-
vcpkg-gcc-v1-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }}
vcpkg-gcc-v1-notest-${{ runner.temp }}-${{ github.base_ref }}-
vcpkg-gcc-v1-notest-${{ runner.temp }}-
- uses: actions/cache@v2
id: ccache
with:
Expand All @@ -85,7 +85,7 @@ jobs:
- name: install Ubuntu dependencies
run: sudo apt install -y git curl build-essential cmake ccache lcov
- name: configure
run: cmake . -DTESTS=ON -DCOVERAGE=ON -DDEBUG=on -DHUNTER_CONFIGURATION_TYPES=Debug
run: cmake . -DTESTS=ON -DCOVERAGE=ON -DDEBUG=on
- name: compile
run: make -j2
- name: run test
Expand All @@ -103,7 +103,7 @@ jobs:
container:
image: docker.io/centos:7
volumes:
- /github/home/.hunter:/github/home/.hunter
- /github/home/vcpkg:/github/home/vcpkg
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -112,14 +112,14 @@ jobs:
id: cache
with:
path: |
/home/runner/.hunter
/github/home/.hunter
/home/runner/vcpkg
/github/home/vcpkg
ccache
key: hunter-centos-v1-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }}
key: vcpkg-centos-v1-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }}
restore-keys: |
hunter-centos-v1-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }}
hunter-centos-v1-notest-${{ runner.temp }}-${{ github.base_ref }}-
hunter-centos-v1-notest-${{ runner.temp }}-
vcpkg-centos-v1-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }}
vcpkg-centos-v1-notest-${{ runner.temp }}-${{ github.base_ref }}-
vcpkg-centos-v1-notest-${{ runner.temp }}-
- name: install CentOS dependencies
run: |
yum install -y epel-release centos-release-scl
Expand All @@ -145,25 +145,25 @@ jobs:
id: cache
with:
path: |
/home/runner/.hunter
/github/home/.hunter
/Users/runner/.hunter
/home/runner/.hunter/_Base/Download/
/github/home/.hunter/_Base/Download/
/Users/runner/.hunter/_Base/Download/
C:/.hunter/
C:/.hunter/_Base/Download/
/home/runner/vcpkg
/github/home/vcpkg
/Users/runner/vcpkg
/home/runner/vcpkg/_Base/Download/
/github/home/vcpkg/_Base/Download/
/Users/runner/vcpkg/_Base/Download/
C:/vcpkg/
C:/vcpkg/_Base/Download/
ccache
key: hunter-msvc-v3-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }}
key: vcpkg-msvc-v3-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }}
restore-keys: |
hunter-msvc-v3-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }}
hunter-msvc-v3-notest-${{ runner.temp }}-${{ github.base_ref }}-
hunter-msvc-v3-notest-${{ runner.temp }}-
vcpkg-msvc-v3-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }}
vcpkg-msvc-v3-notest-${{ runner.temp }}-${{ github.base_ref }}-
vcpkg-msvc-v3-notest-${{ runner.temp }}-
- name: Add MSbuild to PATH
uses: microsoft/setup-msbuild@v1.1
- name: configure
if: runner.os == 'Windows'
run: mkdir -p build && cd build && cmake -G "Visual Studio 16 2019" -A x64 ../ -DHUNTER_STATUS_DEBUG=ON
run: mkdir -p build && cd build && cmake -G "Visual Studio 16 2019" -A x64 ../
- name: compile
run:
cd build && MSBuild /version && MSBuild bcos-utilities.sln /p:Configuration=Release /p:Platform=x64
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,7 @@
*.exe
*.out
*.app

build
# vcpkg
vcpkg
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/microsoft/vcpkg
39 changes: 13 additions & 26 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,47 +16,38 @@
# limitations under the License.
#------------------------------------------------------------------------------

cmake_minimum_required(VERSION 3.10)
set(CMAKE_OSX_DEPLOYMENT_TARGET "11.3" CACHE STRING "Minimum OS X deployment version")
cmake_minimum_required(VERSION 3.14)

if (NOT DEFINED URL_BASE)
set(URL_BASE "github.com")
# set(URL_BASE "git.luolix.top.cnpmjs.org")
endif()

set(BCOS_CMAKE_SCRIPTS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/bcos-cmake-scripts)
set(BCOS_UTILITIES_CMAKE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake" CACHE PATH "The cmake path for the library")
list(APPEND CMAKE_MODULE_PATH ${BCOS_CMAKE_SCRIPTS_DIR})
list(APPEND CMAKE_MODULE_PATH ${BCOS_UTILITIES_CMAKE_DIR})
#init hunter
include(HunterGate)
HunterGate(
URL "https://${URL_BASE}/FISCO-BCOS/hunter/archive/162ff7cde3d843e43afdab8fe3214275c35ef168.tar.gz"
SHA1 "0ba8099fe89beb0d44986c750fe0d44040725d99"
FILEPATH "${BCOS_UTILITIES_CMAKE_DIR}/config.cmake"
)
project(bcos-utilities VERSION "1.0.0")
set(VERSION_SUFFIX "-rc3")
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)

# basic settings
set(VERSION_SUFFIX "")
include(Options)
configure_project()

# vcpkg init
find_package(Git REQUIRED)
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake" CACHE STRING "Vcpkg toolchain file")

project(bcos-utilities VERSION "1.0.0")

include(CompilerSettings)

include_directories(${CMAKE_INSTALL_INCLUDEDIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_BINARY_DIR})

# install dependencies
hunter_add_package(Boost COMPONENTS all)
if(NOT MSVC)
hunter_add_package(range-v3)
find_package(range-v3 CONFIG REQUIRED)
endif()
# for compile
set(BCOS_UTILITIES_TARGET "bcos-utilities")
add_subdirectory(bcos-utilities)

print_config("bcos-utilities")

if (TESTS)
enable_testing()
set(CTEST_OUTPUT_ON_FAILURE TRUE)
Expand All @@ -78,10 +69,6 @@ install(
# install the include files for hash
include(InstallInclude)

# for doxygen
include(BuildDocs)
buildDoc(doc)

# for code coverage
if (COVERAGE)
include(Coverage)
Expand Down
Loading

0 comments on commit f7c61d5

Please sign in to comment.