Skip to content
Merged
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
41 changes: 39 additions & 2 deletions .github/workflows/ci-expanded.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1435,6 +1435,22 @@ jobs:
coverage: ""
options: ""

- image: windows-latest
preset: "win-msvc-release-shared"
cc: ""
cxx: ""
flags: ""
coverage: ""
options: ""

- image: windows-latest
preset: "win-clangcl-release-shared"
cc: ""
cxx: ""
flags: ""
coverage: ""
options: ""

- image: ubuntu-24.04
preset: "nix-gnu-debug-shared"
cc: "clang-19"
Expand Down Expand Up @@ -1756,7 +1772,7 @@ jobs:
- name: Environmental Computation
shell: bash
run: |
if [[ "${{ matrix.preset }}" == *shared* ]]; then
if [[ "${{ matrix.preset }}" == *shared* && "${{ matrix.image }}" != windows* ]]; then
echo "LDFLAGS=-Wl,-rpath,${{ github.workspace }}/prefix/lib" >> $GITHUB_ENV
fi

Expand Down Expand Up @@ -1864,6 +1880,20 @@ jobs:
tests: "*"
options: ""

- image: windows-latest
configuration: "DynamicRelease"
platform: "x64"
version: "vs2026"
tests: "*"
options: ""

- image: windows-latest
configuration: "DynamicDebug"
platform: "x64"
version: "vs2026"
tests: "*"
options: ""

- image: windows-2025-vs2026
configuration: "StaticRelease"
platform: "x64"
Expand Down Expand Up @@ -1892,6 +1922,13 @@ jobs:
tests: "*"
options: "--build-compiler clang"

- image: windows-latest
configuration: "DynamicRelease"
platform: "x64"
version: "vs2026"
tests: "*"
options: "--build-compiler clang"

- image: windows-11-vs2026-arm
configuration: "StaticRelease"
platform: "ARM64"
Expand Down Expand Up @@ -2017,7 +2054,7 @@ jobs:
working-directory: 'libbitcoin-node'
run: |
Write-Host "Locating test executables..." -ForegroundColor Yellow;
$BC_TEST_EXES = @(Get-ChildItem -Path "bin" -recurse | Where-Object { $_.Name -eq "libbitcoin-node-test.exe" });
$BC_TEST_EXES = @(Get-ChildItem -Path "bin", "..\bin" -recurse -ErrorAction SilentlyContinue | Where-Object { $_.Name -eq "libbitcoin-node-test.exe" });
If ($BC_TEST_EXES.Count -ne 1) {
Write-Host "Failure, invalid count of test executables." -ForegroundColor Red;
exit 1;
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ jobs:
- name: Environmental Computation
shell: bash
run: |
if [[ "${{ matrix.preset }}" == *shared* ]]; then
if [[ "${{ matrix.preset }}" == *shared* && "${{ matrix.image }}" != windows* ]]; then
echo "LDFLAGS=-Wl,-rpath,${{ github.workspace }}/prefix/lib" >> $GITHUB_ENV
fi

Expand Down Expand Up @@ -1016,7 +1016,7 @@ jobs:
working-directory: 'libbitcoin-node'
run: |
Write-Host "Locating test executables..." -ForegroundColor Yellow;
$BC_TEST_EXES = @(Get-ChildItem -Path "bin" -recurse | Where-Object { $_.Name -eq "libbitcoin-node-test.exe" });
$BC_TEST_EXES = @(Get-ChildItem -Path "bin", "..\bin" -recurse -ErrorAction SilentlyContinue | Where-Object { $_.Name -eq "libbitcoin-node-test.exe" });
If ($BC_TEST_EXES.Count -ne 1) {
Write-Host "Failure, invalid count of test executables." -ForegroundColor Red;
exit 1;
Expand Down
65 changes: 57 additions & 8 deletions builds/cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,25 +70,48 @@ set( repository_root_dir "${CMAKE_CURRENT_SOURCE_DIR}/../.." )
if ( MSVC )
set( CMAKE_STATIC_LIBRARY_PREFIX "lib" )
set( CMAKE_SHARED_LIBRARY_PREFIX "lib" )
set( CMAKE_IMPORT_LIBRARY_PREFIX "lib" )

if ( BUILD_SHARED_LIBS )
message( FATAL_ERROR "Shared libraries are not supported with the MSVC frontend." )
set( CMAKE_MSVC_RUNTIME_LIBRARY
"$<IF:$<CONFIG:Debug>,MultiThreadedDebugDLL,MultiThreadedDLL>" )
else()
set( CMAKE_MSVC_RUNTIME_LIBRARY
"$<IF:$<CONFIG:Debug>,MultiThreadedDebug,MultiThreaded>" )
endif()

set( CMAKE_C_FLAGS_DEBUG "/Od /Ob1 /Oi /Gy /RTC1 /Zi" )
set( CMAKE_CXX_FLAGS_DEBUG "/Od /Ob1 /Oi /Gy /RTC1 /Zi" )
set( CMAKE_C_FLAGS_RELEASE "/O2 /Ob2 /Oi /Ot /Oy /GT /Qpar /Gy /GF /GS- /guard:cf- /Zi" )
set( CMAKE_CXX_FLAGS_RELEASE "/O2 /Ob2 /Oi /Ot /Oy /GT /Qpar /Gy /GF /GS- /guard:cf- /Zi" )

add_compile_options(
/W4
/bigobj
/permissive-
/bigobj
/Zc:__cplusplus
/Zc:preprocessor
$<$<CXX_COMPILER_ID:Clang>:-Wno-unused-command-line-argument> )
$<$<CXX_COMPILER_ID:Clang>:-Wno-unused-command-line-argument>
)

add_compile_definitions(
UNICODE
_UNICODE
WIN32_LEAN_AND_MEAN
NOMINMAX
_WIN32_WINNT=0x0A00 )
_WIN32_WINNT=0x0A00
$<$<CONFIG:Debug>:_DEBUG>
$<$<CONFIG:Debug>:_CRTDBG_MAP_ALLOC>
$<$<CONFIG:Release>:NDEBUG>
)

add_link_options(
/ignore:4099
$<$<CONFIG:Debug>:/DEBUG>
$<$<CONFIG:Release>:/DEBUG>
$<$<CONFIG:Release>:/OPT:REF>
$<$<CONFIG:Release>:/OPT:ICF>
)
endif()

# Link POSIX threads on BSD.
Expand Down Expand Up @@ -244,10 +267,21 @@ if ( NOT MSVC )
endif()

if ( MSVC )
target_compile_definitions( libbitcoin-node
PUBLIC
BCN_STATIC
)
if ( BUILD_SHARED_LIBS )
target_compile_definitions( libbitcoin-node
PRIVATE
BCN_DLL
_DLL
_WINDLL
)
else()
target_compile_definitions( libbitcoin-node
PUBLIC
BCN_STATIC
PRIVATE
_LIB
)
endif()
endif()

file( GLOB_RECURSE libbitcoin_node_HEADERS CONFIGURE_DEPENDS
Expand Down Expand Up @@ -326,6 +360,14 @@ if ( with-tests )
--build_info=yes
)

if ( WIN32 AND BUILD_SHARED_LIBS )
set_tests_properties( libbitcoin-node-test
PROPERTIES
ENVIRONMENT_MODIFICATION
"PATH=path_list_prepend:$<JOIN:$<TARGET_RUNTIME_DLL_DIRS:libbitcoin-node-test>,\;>"
)
endif()

target_compile_features( libbitcoin-node-test
PUBLIC
cxx_std_20
Expand All @@ -349,6 +391,13 @@ if ( with-tests )
)
endif()

if ( MSVC )
target_compile_definitions( libbitcoin-node-test
PRIVATE
_CONSOLE
)
endif()

file( GLOB_RECURSE libbitcoin_node_test_SOURCES CONFIGURE_DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/../../test/*.c"
"${CMAKE_CURRENT_SOURCE_DIR}/../../test/*.cpp"
Expand Down
75 changes: 73 additions & 2 deletions builds/cmake/CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,7 @@
"CMAKE_INSTALL_PREFIX_PATH": {
"type": "PATH",
"value": "${sourceParentDir}/../../../prefix/${presetName}"
},
"CMAKE_MSVC_RUNTIME_LIBRARY": "MultiThreaded$<$<CONFIG:Debug>:Debug>"
}
}
},
{
Expand Down Expand Up @@ -198,6 +197,30 @@
"win-base"
]
},
{
"name": "win-msvc-debug-shared",
"displayName": "Windows/MSVC/Debug/Shared",
"description": "Debug build with msvc and shared linking.",
"hidden": false,
"inherits": [
"shared",
"win-debug",
"msvc",
"win-base"
]
},
{
"name": "win-msvc-release-shared",
"displayName": "Windows/MSVC/Release/Shared",
"description": "Release build with msvc and shared linking.",
"hidden": false,
"inherits": [
"shared",
"win-release",
"msvc",
"win-base"
]
},
{
"name": "win-clangcl-debug-static",
"displayName": "Windows/clang-cl/Debug/Static",
Expand All @@ -221,6 +244,30 @@
"clangcl",
"win-base"
]
},
{
"name": "win-clangcl-debug-shared",
"displayName": "Windows/clang-cl/Debug/Shared",
"description": "Debug build with clang-cl and shared linking.",
"hidden": false,
"inherits": [
"shared",
"win-debug",
"clangcl",
"win-base"
]
},
{
"name": "win-clangcl-release-shared",
"displayName": "Windows/clang-cl/Release/Shared",
"description": "Release build with clang-cl and shared linking.",
"hidden": false,
"inherits": [
"shared",
"win-release",
"clangcl",
"win-base"
]
}
],
"buildPresets": [
Expand Down Expand Up @@ -268,6 +315,18 @@
"inherits": [ "nix-target-list" ],
"configurePreset": "win-msvc-release-static"
},
{
"name": "win-msvc-debug-shared",
"displayName": "Windows/MSVC/Debug/Shared",
"inherits": [ "nix-target-list" ],
"configurePreset": "win-msvc-debug-shared"
},
{
"name": "win-msvc-release-shared",
"displayName": "Windows/MSVC/Release/Shared",
"inherits": [ "nix-target-list" ],
"configurePreset": "win-msvc-release-shared"
},
{
"name": "win-clangcl-debug-static",
"displayName": "Windows/clang-cl/Debug/Static",
Expand All @@ -279,6 +338,18 @@
"displayName": "Windows/clang-cl/Release/Static",
"inherits": [ "nix-target-list" ],
"configurePreset": "win-clangcl-release-static"
},
{
"name": "win-clangcl-debug-shared",
"displayName": "Windows/clang-cl/Debug/Shared",
"inherits": [ "nix-target-list" ],
"configurePreset": "win-clangcl-debug-shared"
},
{
"name": "win-clangcl-release-shared",
"displayName": "Windows/clang-cl/Release/Shared",
"inherits": [ "nix-target-list" ],
"configurePreset": "win-clangcl-release-shared"
}
]
}
16 changes: 16 additions & 0 deletions builds/cmake/install-presets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,14 @@ main()
msg_verbose "BUILD_PRESET value 'win-msvc-release-static'."
BUILD_CONFIG="release"
BUILD_LINK="static"
elif [[ "${BUILD_PRESET}" == "win-msvc-debug-shared" ]]; then
msg_verbose "BUILD_PRESET value 'win-msvc-debug-shared'."
BUILD_CONFIG="debug"
BUILD_LINK="dynamic"
elif [[ "${BUILD_PRESET}" == "win-msvc-release-shared" ]]; then
msg_verbose "BUILD_PRESET value 'win-msvc-release-shared'."
BUILD_CONFIG="release"
BUILD_LINK="dynamic"
elif [[ "${BUILD_PRESET}" == "win-clangcl-debug-static" ]]; then
msg_verbose "BUILD_PRESET value 'win-clangcl-debug-static'."
BUILD_CONFIG="debug"
Expand All @@ -247,6 +255,14 @@ main()
msg_verbose "BUILD_PRESET value 'win-clangcl-release-static'."
BUILD_CONFIG="release"
BUILD_LINK="static"
elif [[ "${BUILD_PRESET}" == "win-clangcl-debug-shared" ]]; then
msg_verbose "BUILD_PRESET value 'win-clangcl-debug-shared'."
BUILD_CONFIG="debug"
BUILD_LINK="dynamic"
elif [[ "${BUILD_PRESET}" == "win-clangcl-release-shared" ]]; then
msg_verbose "BUILD_PRESET value 'win-clangcl-release-shared'."
BUILD_CONFIG="release"
BUILD_LINK="dynamic"
else
msg_error "Unrecognized build-preset value '${BUILD_PRESET}'."
help
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<!--
| Copyright (c) 2014-2026 libbitcoin-node developers (see COPYING).
|
| GENERATED SOURCE CODE, DO NOT EDIT EXCEPT EXPERIMENTALLY
|
-->
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup>
<_PropertySheetDisplayName>ARM64 Settings</_PropertySheetDisplayName>
</PropertyGroup>

<ItemDefinitionGroup>
<ClCompile>
<!-- Note that Win32 defines may cause WIN32 to become defined when using Windows headers,
but _WIN32 implies Windows 32-bit or above. These are safe for ARM64 builds and ensure
compatibility with Windows headers. _ARM64 indicates the ARM64 architecture. -->
<PreprocessorDefinitions>WIN32;_WIN32;_ARM64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
Expand All @@ -20,4 +23,10 @@
</Lib>
</ItemDefinitionGroup>

</Project>
<ItemDefinitionGroup Condition="'$(PlatformToolset)' == 'ClangCL'">
<ClCompile>
<AdditionalOptions>--target=aarch64-pc-windows-msvc %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
</ItemDefinitionGroup>

</Project>
Loading
Loading