Skip to content

Commit

Permalink
unified boost version
Browse files Browse the repository at this point in the history
  • Loading branch information
Shareong committed Mar 14, 2024
1 parent d7c51fa commit 314fc79
Show file tree
Hide file tree
Showing 20 changed files with 89 additions and 364 deletions.
39 changes: 3 additions & 36 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ jobs:
- name: install CentOS dependencies
run: |
yum install -y epel-release centos-release-scl
yum install -y git make gcc gcc-c++ glibc-static glibc-devel openssl cmake3 ccache devtoolset-7 libzstd-devel zlib-devel flex bison python-devel python3-devel && source /opt/rh/devtoolset-7/enable
yum install -y make gcc gcc-c++ glibc-static glibc-devel openssl cmake3 ccache devtoolset-7 libzstd-devel zlib-devel flex bison python-devel python3-devel && source /opt/rh/devtoolset-7/enable
yum reinstall -y -q https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm
yum install -y -q git
- name: configure
run: |
source /opt/rh/devtoolset-7/enable
Expand All @@ -137,38 +139,3 @@ jobs:
source /opt/rh/devtoolset-7/enable
mkdir -p build && cd build
make -j4
build_with_windows:
name: build_with_windows
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2019]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 5
- uses: actions/cache@v2
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/
ccache
key: hunter-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 }}-
- name: Add MSbuild to PATH
uses: microsoft/[email protected]
- name: configure
if: runner.os == 'Windows'
run: mkdir -p build && cd build && cmake -G "Visual Studio 16 2019" -A x64 ../ -DHUNTER_CONFIGURATION_TYPES=Release -DHUNTER_STATUS_DEBUG=ON
- name: compile
run: cd build && MSBuild bcos-boostssl.sln /p:Configuration=Release /p:Platform=x64
6 changes: 2 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
# ------------------------------------------------------------------------------

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

include(FetchContent)

Expand Down Expand Up @@ -45,9 +44,8 @@ include(Options)
configure_project()
include(CompilerSettings)

# Boost
hunter_add_package(Boost COMPONENTS all)
find_package(Boost CONFIG REQUIRED log chrono system filesystem thread iostreams)
# dependencies environment
include(DepsEnv)

# OpenSSL
hunter_add_package(OpenSSL)
Expand Down
3 changes: 1 addition & 2 deletions bcos-boostssl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ file(GLOB_RECURSE SRCS "*.cpp")
file(GLOB_RECURSE HEADERS "*.h")

add_library(${BOOSTSSL_TARGET} ${SRCS} ${HEADERS})
target_link_libraries(${BOOSTSSL_TARGET} PUBLIC bcos-utilities Boost::system Boost::filesystem
Boost::log Boost::chrono Boost::iostreams Boost::thread OpenSSL::SSL OpenSSL::Crypto)
target_link_libraries(${BOOSTSSL_TARGET} PUBLIC bcos-utilities OpenSSL::SSL OpenSSL::Crypto)
4 changes: 2 additions & 2 deletions bcos-boostssl/utility/NewTimer.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
*/
#pragma once
#include "bcos-utilities/BoostLog.h"
#include "bcos-utilities/Common.h"
#include <boost/asio.hpp>
#include <boost/asio/steady_timer.hpp>
#include "bcos-utilities/Common.h"
#include <exception>

namespace bcos
Expand Down Expand Up @@ -249,7 +249,7 @@ class TimerFactory
BCOS_LOG(INFO) << LOG_BADGE("stopThread") << LOG_DESC("stop the timer thread");

m_ioService->stop();
if (m_worker->get_id() != std::this_thread::get_id())
if (!(m_worker->get_id() == std::this_thread::get_id()))
{
m_worker->join();
m_worker.reset();
Expand Down
35 changes: 0 additions & 35 deletions cmake/BuildDocs.cmake

This file was deleted.

2 changes: 2 additions & 0 deletions cmake/CompilerSettings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA
add_compile_options(-Wall)
add_compile_options(-pedantic)
add_compile_options(-Wextra)
add_compile_options(-Wno-sign-compare)
add_compile_options(-Wno-deprecated-declarations)
# add_compile_options(-Wno-unused-variable)
# add_compile_options(-Wno-unused-parameter)
# add_compile_options(-Wno-unused-function)
Expand Down
22 changes: 0 additions & 22 deletions cmake/CopyClangFormat.cmake

This file was deleted.

58 changes: 58 additions & 0 deletions cmake/DepsEnv.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
set(SYSTEM_NAME "linux")
elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
set(SYSTEM_NAME "osx")
else()
message(FATAL_ERROR "Unknown operating system: ${CMAKE_SYSTEM_NAME}")
endif()

if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
set(PROCESSOR_NAME "x64")
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")
set(PROCESSOR_NAME "arm64")
else()
message(FATAL_ERROR "Unknown processor name: ${CMAKE_SYSTEM_PROCESSOR}")
endif()

set(BCOS_UTILITIES_PROJECT BcosUtilitiesProject)

set(VCPKG_BUILD_PATH ${CMAKE_CURRENT_SOURCE_DIR}/deps/src/${BCOS_UTILITIES_PROJECT}/vcpkg_installed/${PROCESSOR_NAME}-${SYSTEM_NAME})
message("vcpkg build path: ${VCPKG_BUILD_PATH}")
set(VCPKG_LIB_PATH ${CMAKE_CURRENT_SOURCE_DIR}/deps/src/${BCOS_UTILITIES_PROJECT}/vcpkg_installed/${PROCESSOR_NAME}-${SYSTEM_NAME}/lib)
message("vcpkg lib path: ${VCPKG_LIB_PATH}")
set(VCPKG_INCLUDE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/deps/src/${BCOS_UTILITIES_PROJECT}/vcpkg_installed/${PROCESSOR_NAME}-${SYSTEM_NAME}/include)
message("vcpkg include path: ${VCPKG_INCLUDE_PATH}")

#include
include_directories(${VCPKG_INCLUDE_PATH})

#lib
#unit_test_framework
set(BOOST_UNIT_TEST ${VCPKG_LIB_PATH}/libboost_unit_test_framework.a)

#log
set(BOOST_LOG ${VCPKG_LIB_PATH}/libboost_log.a)

#log_setup
set(BOOST_LOG_SETUP ${VCPKG_LIB_PATH}/libboost_log_setup.a)

#filesystem
set(BOOST_FILESYSTEM ${VCPKG_LIB_PATH}/libboost_filesystem.a)

#chrono
set(BOOST_CHRONO ${VCPKG_LIB_PATH}/libboost_chrono.a)

#thread
set(BOOST_THREAD ${VCPKG_LIB_PATH}/libboost_thread.a)

#serialization
set(BOOST_SERIALIZATION ${VCPKG_LIB_PATH}/libboost_serialization.a)

#iostreams
set(BOOST_IOSTREAMS ${VCPKG_LIB_PATH}/libboost_iostreams.a)

#system
set(BOOST_SYSTEM ${VCPKG_LIB_PATH}/libboost_system.a)

#zlib
set(ZLIB ${VCPKG_LIB_PATH}/libz.a)
21 changes: 0 additions & 21 deletions cmake/GenerateSources.cmake

This file was deleted.

4 changes: 0 additions & 4 deletions cmake/InstallBoostSSL.cmake

This file was deleted.

Loading

0 comments on commit 314fc79

Please sign in to comment.