Skip to content

Commit

Permalink
Merge pull request #570 from pmienk/version3
Browse files Browse the repository at this point in the history
Regenerate artifacts.
  • Loading branch information
pmienk authored Feb 10, 2024
2 parents ac290ac + 830f237 commit ac0bf7d
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 57 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Prepare toolchain [generic]
run: |
Expand All @@ -146,7 +146,7 @@ jobs:
shell: bash
run: |
WORKSPACE_SUBPATH="${GITHUB_WORKSPACE%libbitcoin-server}"
echo "LIBBITCOIN_SRC_PATH=$WORKSPACE_SUBPATH" >> $GITHUB_ENV
echo "LIBBITCOIN_SRC_PATH=${WORKSPACE_SUBPATH}" >> $GITHUB_ENV
if [[ ${{ matrix.assert }} == 'ndebug' ]]; then
echo "ASSERT_NDEBUG=--enable-ndebug" >> $GITHUB_ENV
else
Expand All @@ -158,7 +158,7 @@ jobs:
echo "LINKAGE=--disable-shared" >> $GITHUB_ENV
fi
if [[ ${{ matrix.link }} == 'dynamic' ]]; then
echo "LDFLAGS=-Wl,-rpath,$WORKSPACE_SUBPATH/prefix/lib" >> $GITHUB_ENV
echo "LDFLAGS=-Wl,-rpath,${WORKSPACE_SUBPATH}prefix/lib" >> $GITHUB_ENV
fi
- name: Display Compiler details
Expand Down Expand Up @@ -362,7 +362,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Prepare toolchain [generic]
run: |
Expand All @@ -383,7 +383,7 @@ jobs:
shell: bash
run: |
WORKSPACE_SUBPATH="${GITHUB_WORKSPACE%libbitcoin-server}"
echo "LIBBITCOIN_SRC_PATH=$WORKSPACE_SUBPATH" >> $GITHUB_ENV
echo "LIBBITCOIN_SRC_PATH=${WORKSPACE_SUBPATH}" >> $GITHUB_ENV
if [[ ${{ matrix.packager }} == 'brew' ]]; then
echo "CMAKE_LIBRARY_PATH=/usr/local/lib" >> $GITHUB_ENV
fi
Expand All @@ -398,7 +398,7 @@ jobs:
echo "LINKAGE=--disable-shared" >> $GITHUB_ENV
fi
if [[ ${{ matrix.link }} == 'dynamic' ]]; then
echo "LDFLAGS=-Wl,-rpath,$WORKSPACE_SUBPATH/prefix/lib" >> $GITHUB_ENV
echo "LDFLAGS=-Wl,-rpath,${WORKSPACE_SUBPATH}prefix/lib" >> $GITHUB_ENV
fi
- name: Display Compiler details
Expand Down Expand Up @@ -567,7 +567,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Prepare toolchain [generic]
run: |
Expand All @@ -588,7 +588,7 @@ jobs:
shell: bash
run: |
WORKSPACE_SUBPATH="${GITHUB_WORKSPACE%libbitcoin-server}"
echo "LIBBITCOIN_SRC_PATH=$WORKSPACE_SUBPATH" >> $GITHUB_ENV
echo "LIBBITCOIN_SRC_PATH=${WORKSPACE_SUBPATH}" >> $GITHUB_ENV
if [[ ${{ matrix.packager }} == 'brew' ]]; then
echo "CMAKE_LIBRARY_PATH=/usr/local/lib" >> $GITHUB_ENV
fi
Expand All @@ -603,7 +603,7 @@ jobs:
echo "LINKAGE=--disable-shared" >> $GITHUB_ENV
fi
if [[ ${{ matrix.link }} == 'dynamic' ]]; then
echo "LDFLAGS=-Wl,-rpath,$WORKSPACE_SUBPATH/prefix/${{ matrix.preset }}/lib" >> $GITHUB_ENV
echo "LDFLAGS=-Wl,-rpath,${WORKSPACE_SUBPATH}prefix/${{ matrix.preset }}/lib" >> $GITHUB_ENV
fi
- name: Display Compiler details
Expand Down Expand Up @@ -730,7 +730,7 @@ jobs:
msbuild-architecture: x64

- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Initialize SDK
shell: powershell
Expand Down
127 changes: 80 additions & 47 deletions builds/cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

# libbitcoin-server project configuration.
#------------------------------------------------------------------------------
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
cmake_minimum_required(VERSION 3.18 FATAL_ERROR)

project(libbitcoin-server LANGUAGES C CXX)

Expand All @@ -18,6 +18,7 @@ include(CheckIncludeFiles)
include(CheckSymbolExists)
include(CheckCXXCompilerFlag)
include(CheckCXXSourceCompiles)
include(CheckLinkerFlag)

set_property(GLOBAL PROPERTY USE_FOLDERS ON)

Expand Down Expand Up @@ -158,11 +159,7 @@ find_package( Boost 1.73.0 REQUIRED COMPONENTS

set( boost_unit_test_framework_LIBS "-lboost_unit_test_framework" )

if (enable-ndebug)
set( Boost_LIBRARY_DIR "${Boost_LIBRARY_DIR_DEBUG}" )
else ()
set( Boost_LIBRARY_DIR "${Boost_LIBRARY_DIR_RELEASE}" )
endif()
set( Boost_LIBRARY_DIR $<IF:$<BOOL:${enable-ndebug}>,"${Boost_LIBRARY_DIR_RELEASE}","${Boost_LIBRARY_DIR_DEBUG}">)

set( boost_CPPFLAGS "-I${Boost_INCLUDE_DIR}" )
set( boost_LDFLAGS "-L${Boost_LIBRARY_DIR}" )
Expand All @@ -181,46 +178,75 @@ find_package( Bitcoin-Node 3.8.0 REQUIRED )
#------------------------------------------------------------------------------
find_package( Bitcoin-Protocol 3.8.0 REQUIRED )

# Define project common includes directories
# Define project common includes for build.
#------------------------------------------------------------------------------
if (BUILD_SHARED_LIBS)
include_directories( SYSTEM
${bitcoin_protocol_INCLUDE_DIRS}
${bitcoin_node_INCLUDE_DIRS} )
set( bitcoin_protocol_FOR_BUILD_INCLUDE_DIRS ${bitcoin_protocol_INCLUDE_DIRS} CACHE STRING "Placeholder" )
set( bitcoin_node_FOR_BUILD_INCLUDE_DIRS ${bitcoin_node_INCLUDE_DIRS} CACHE STRING "Placeholder" )
else()
include_directories( SYSTEM
${bitcoin_protocol_STATIC_INCLUDE_DIRS}
${bitcoin_node_STATIC_INCLUDE_DIRS} )
set( bitcoin_protocol_FOR_BUILD_INCLUDE_DIRS ${bitcoin_protocol_STATIC_INCLUDE_DIRS} CACHE STRING "Placeholder" )
set( bitcoin_node_FOR_BUILD_INCLUDE_DIRS ${bitcoin_node_STATIC_INCLUDE_DIRS} CACHE STRING "Placeholder" )
endif()

# Define project common library directories
# Define project common includes directories
#------------------------------------------------------------------------------
include_directories( SYSTEM
${bitcoin_protocol_FOR_BUILD_INCLUDE_DIRS}
${bitcoin_node_FOR_BUILD_INCLUDE_DIRS} )

# Define project common library directories for build.
#------------------------------------------------------------------------------
if (BUILD_SHARED_LIBS)
link_directories(
${bitcoin_protocol_LIBRARY_DIRS}
${bitcoin_node_LIBRARY_DIRS} )
set( bitcoin_protocol_FOR_BUILD_LIBRARY_DIRS ${bitcoin_protocol_LIBRARY_DIRS} CACHE STRING "Placeholder" )
set( bitcoin_node_FOR_BUILD_LIBRARY_DIRS ${bitcoin_node_LIBRARY_DIRS} CACHE STRING "Placeholder" )
else()
link_directories(
${bitcoin_protocol_STATIC_LIBRARY_DIRS}
${bitcoin_node_STATIC_LIBRARY_DIRS} )
set( bitcoin_protocol_FOR_BUILD_LIBRARY_DIRS ${bitcoin_protocol_STATIC_LIBRARY_DIRS} CACHE STRING "Placeholder" )
set( bitcoin_node_FOR_BUILD_LIBRARY_DIRS ${bitcoin_node_STATIC_LIBRARY_DIRS} CACHE STRING "Placeholder" )
endif()

# Define project common library directories
#------------------------------------------------------------------------------
link_directories(
${bitcoin_protocol_FOR_BUILD_LIBRARY_DIRS}
${bitcoin_node_FOR_BUILD_LIBRARY_DIRS} )

# Define project common linker flags.
#------------------------------------------------------------------------------
check_linker_flag(CXX "-no_fixup_chains" "no_fixup_chains_FOUND")

if (no_fixup_chains_FOUND)
add_link_options("-no_fixup_chains")
endif()

check_linker_flag(CXX "-fstack-protector" "fstack_protector_FOUND")

if (fstack_protector_FOUND)
add_link_options("-fstack-protector")
endif()

check_linker_flag(CXX "-fstack-protector-all" "fstack_protector_all_FOUND")

if (fstack_protector_all_FOUND)
add_link_options("-fstack-protector-all")
endif()

# Define project common libraries/linker flags.

# Define common library usage for build.
#------------------------------------------------------------------------------
if (BUILD_SHARED_LIBS)
link_libraries(
"-fstack-protector"
"-fstack-protector-all"
${bitcoin_protocol_LIBRARIES}
${bitcoin_node_LIBRARIES} )
set( bitcoin_protocol_FOR_BUILD_LIBRARIES ${bitcoin_protocol_LIBRARIES} CACHE STRING "Placeholder" )
set( bitcoin_node_FOR_BUILD_LIBRARIES ${bitcoin_node_LIBRARIES} CACHE STRING "Placeholder" )
else()
link_libraries(
"-fstack-protector"
"-fstack-protector-all"
${bitcoin_protocol_STATIC_LIBRARIES}
${bitcoin_node_STATIC_LIBRARIES} )
set( bitcoin_protocol_FOR_BUILD_LIBRARIES ${bitcoin_protocol_STATIC_LIBRARIES} CACHE STRING "Placeholder" )
set( bitcoin_node_FOR_BUILD_LIBRARIES ${bitcoin_node_STATIC_LIBRARIES} CACHE STRING "Placeholder" )
endif()

# Define project common libraries.
#------------------------------------------------------------------------------
link_libraries(
${bitcoin_protocol_FOR_BUILD_LIBRARIES}
${bitcoin_node_FOR_BUILD_LIBRARIES} )

add_definitions(
-DSYSCONFDIR=\"${sysconfdir}\" )

Expand All @@ -246,35 +272,42 @@ add_library( ${CANONICAL_LIB_NAME}
"../../src/workers/notification_worker.cpp"
"../../src/workers/query_worker.cpp" )

# ${CANONICAL_LIB_NAME} project specific include directories.
# ${CANONICAL_LIB_NAME} project specific include directory normalization for build.
#------------------------------------------------------------------------------
if (BUILD_SHARED_LIBS)
target_include_directories( ${CANONICAL_LIB_NAME} PRIVATE
"../../include"
${bitcoin_protocol_INCLUDE_DIRS}
${bitcoin_node_INCLUDE_DIRS} )
set( bitcoin_protocol_FOR_BUILD_INCLUDE_DIRS ${bitcoin_protocol_INCLUDE_DIRS} CACHE STRING "Placeholder" )
set( bitcoin_node_FOR_BUILD_INCLUDE_DIRS ${bitcoin_node_INCLUDE_DIRS} CACHE STRING "Placeholder" )
else()
target_include_directories( ${CANONICAL_LIB_NAME} PRIVATE
"../../include"
${bitcoin_protocol_STATIC_INCLUDE_DIRS}
${bitcoin_node_STATIC_INCLUDE_DIRS} )
set( bitcoin_protocol_FOR_BUILD_INCLUDE_DIRS ${bitcoin_protocol_STATIC_INCLUDE_DIRS} CACHE STRING "Placeholder" )
set( bitcoin_node_FOR_BUILD_INCLUDE_DIRS ${bitcoin_node_STATIC_INCLUDE_DIRS} CACHE STRING "Placeholder" )
endif()

# ${CANONICAL_LIB_NAME} project specific include directories.
#------------------------------------------------------------------------------
target_include_directories( ${CANONICAL_LIB_NAME} PRIVATE
"../../include"
${bitcoin_protocol_FOR_BUILD_INCLUDE_DIRS}
${bitcoin_node_FOR_BUILD_INCLUDE_DIRS} )

target_include_directories( ${CANONICAL_LIB_NAME} PUBLIC
"../../include" )

# ${CANONICAL_LIB_NAME} project specific libraries/linker flags.
# ${CANONICAL_LIB_NAME} project specific libraries noramalization for build.
#------------------------------------------------------------------------------
if (BUILD_SHARED_LIBS)
target_link_libraries( ${CANONICAL_LIB_NAME}
${bitcoin_protocol_LIBRARIES}
${bitcoin_node_LIBRARIES} )
set( bitcoin_protocol_FOR_BUILD_LIBRARIES ${bitcoin_protocol_LIBRARIES} CACHE STRING "Placeholder" )
set( bitcoin_node_FOR_BUILD_LIBRARIES ${bitcoin_node_LIBRARIES} CACHE STRING "Placeholder" )
else()
target_link_libraries( ${CANONICAL_LIB_NAME}
${bitcoin_protocol_STATIC_LIBRARIES}
${bitcoin_node_STATIC_LIBRARIES} )
set( bitcoin_protocol_FOR_BUILD_LIBRARIES ${bitcoin_protocol_STATIC_LIBRARIES} CACHE STRING "Placeholder" )
set( bitcoin_node_FOR_BUILD_LIBRARIES ${bitcoin_node_STATIC_LIBRARIES} CACHE STRING "Placeholder" )
endif()

# ${CANONICAL_LIB_NAME} project specific libraries/linker flags.
#------------------------------------------------------------------------------
target_link_libraries( ${CANONICAL_LIB_NAME}
${bitcoin_protocol_FOR_BUILD_LIBRARIES}
${bitcoin_node_FOR_BUILD_LIBRARIES} )

# Define libbitcoin-server-test project.
#------------------------------------------------------------------------------
if (with-tests)
Expand Down
6 changes: 6 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,12 @@ AS_CASE([${CC}], [*clang*],
[AX_CHECK_COMPILE_FLAG([-Wno-mismatched-tags],
[CXXFLAGS="$CXXFLAGS -Wno-mismatched-tags"])])

# Address -undefined dynamic_lookup MacOS error.
#------------------------------------------------------------------------------
AS_CASE([${CC}], [*],
[AX_CHECK_LINK_FLAG([-no_fixup_chains],
[LDFLAGS="$LDFLAGS -no_fixup_chains"])])

# Protect stack.
#------------------------------------------------------------------------------
AS_CASE([${CC}], [*],
Expand Down

0 comments on commit ac0bf7d

Please sign in to comment.