Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
be79cc2
Add ultrafast NuGet dependency (disabled by default).
evoskuil Jun 12, 2026
d63e3e7
Add "Linkage-ultrafast" link status message to vs props files.
evoskuil Jun 12, 2026
6cec5f5
Changes to install/test/clean.
pmienk Jun 11, 2026
9403d70
Correct variable name matching when option name override is present.
pmienk Jun 11, 2026
7bb6dac
Changes toa support mixing gnu/cmake toolchain usage for dependencies.
pmienk Jun 12, 2026
bacfedb
Add required canonical identifier for install scripts, add Ultrafast …
pmienk Jun 12, 2026
54dcc30
Migrate version.hpp to version.hpp.in generation in vNext, adapt CMak…
pmienk May 15, 2026
d1f30f3
Working cmake version.hpp.in integration.
pmienk May 15, 2026
308c3b3
Remove extra whitespace.
pmienk May 16, 2026
df4956f
Update sln to vNext.
pmienk May 19, 2026
f46bf28
Add packages.config generation to vNext.
pmienk May 21, 2026
b5f664b
Colocate toolchain (msbuild) specific configuration.
pmienk May 22, 2026
d5074a0
Normalize global usage in lib.
pmienk May 22, 2026
fbb8d5e
Update vcxproj.filters to vNext.
pmienk May 26, 2026
37b3086
Correct resource.rc/resource.h.
pmienk May 26, 2026
61e1c46
Partial vcxproj generation.
pmienk May 29, 2026
dc0b4ce
Extends nuget/project references.
pmienk Jun 2, 2026
f9fc48b
Disable version.hpp.in, add version.hpp generation to match original …
pmienk Jun 12, 2026
73467c4
Updates to match ordering, minimize disruption.
pmienk Jun 13, 2026
f32661f
Add UltrafastSecp256k1 nuget packages.
pmienk Jun 13, 2026
dea4713
Xml changes to enable errored ultrafast dependency with working secp2…
pmienk Jun 13, 2026
583afd3
Comment out nonexistant nuget package.
pmienk Jun 13, 2026
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
20 changes: 9 additions & 11 deletions generate4.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
<option type="enable" name="ndebug" default="yes" define="NDEBUG" description="Compile without debug assertions." />
<option type="enable" name="shared" default="yes" define="BOOST_ALL_DYN_LINK" inherited="true" description="Required for dynamically linking boost test." />

<option type="with" name="ultrafast" default="no" description="Use shrec/UltrafastSecp256k1 library." />
<option type="with" name="secp256k1" default="yes" description="Use bitcoin-core/secp256k1 library." />

<!-- Boost bugs we need to avoid. -->
<!-- https://trac.macports.org/ticket/42282 [clang, 1.55] -->
<!-- https://svn.boost.org/trac/boost/ticket/8973 [gcc, 1.54] -->
Expand All @@ -40,7 +43,8 @@
<!-- <dependency name="pthread" system_exclude="android" /> -->
<!-- <dependency name="rt" function="clock_gettime" system="linux" system_exclude="android" /> -->
<!-- Arbitrary minimum version, current nuget package is v0.6.1. -->
<dependency name="secp256k1" version="0.5.1.0" />
<dependency name="secp256k1" version="0.5.1.0" option="secp256k1" />
<dependency name="ultrafast" version="4.1.1.4" option="ultrafast" />

<!-- General flags -->
<flag name="std=c++20" comment="Require c++20 for all c++ products." context="c++" />
Expand Down Expand Up @@ -864,12 +868,15 @@
<package compiler="vc145" name="libbitcoin-boost_url-vc145" version="1.91.0" />
</resource>
<resource canonical="secp256k1">
<!-- The vc120 secp256k1 nuget package is no longer supported -->
<package compiler="vc141" name="secp256k1_vc141" version="0.1.0.20" />
<package compiler="vc142" name="secp256k1_vc142" version="0.1.0.20" />
<package compiler="vc143" name="secp256k1_vc143" version="0.6.1" />
<package compiler="vc145" name="secp256k1_vc145" version="0.6.1.2" />
</resource>
<resource canonical="ultrafast">
<package compiler="vc143" name="UltrafastSecp256k1-vc143" version="4.1.1.4" />
<package compiler="vc145" name="UltrafastSecp256k1-vc145" version="4.1.1.4" />
</resource>
</nuget>

<vs path="version4">
Expand Down Expand Up @@ -941,9 +948,6 @@
</integration>

<templates source="generate4.xml">
<!-- common sources -->
<template name="gsl.version.hpp" />

<!-- common artifacts -->
<template name="gsl.package.pc.in" />

Expand All @@ -954,12 +958,6 @@

<!-- msvc -->
<template name="gsl.debug.natvis" />
<template name="gsl.packages.config" />
<template name="gsl.sln" />
<template name="gsl.vcxproj" />
<template name="gsl.vcxproj.filters" />

<!-- <template name="gsl.gitignore" /> -->
</templates>

</generate>
2 changes: 1 addition & 1 deletion lib/cmake-output.gsl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#------------------------------------------------------------------------------
.endmacro
.
.macro emit_find_dependency(dependency, target, repository, host, function_name)
.macro global.emit_find_dependency(dependency, target, repository, host, function_name)
. define my.dependency = emit_find_dependency.dependency
. define my.target = emit_find_dependency.target
. define my.repository = emit_find_dependency.repository
Expand Down
201 changes: 192 additions & 9 deletions lib/filesystem.gsl
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,211 @@ gsl from "../library/string.gsl"
#------------------------------------------------------------------------------
# Path manipulation tools.
#------------------------------------------------------------------------------
function path_append(basepath, baserelativepath)
if (!is_empty(my.basepath))
if (!ends_with(my.basepath, "/") & !ends_with(my.basepath, "\\"))
return "$(my.basepath)/$(my.baserelativepath)"
else
return "$(my.basepath)$(my.baserelativepath)"
endif
function global.path_append(base_path, base_relative_path)
if is_empty(my.base_path)
return my.base_relative_path
endif

if !ends_with(my.base_path, "/") & !starts_with(my.base_relative_path, "/")
return "$(my.base_path)/$(my.base_relative_path)"
endif
return "$(my.baserelativepath)"

return "$(my.base_path)$(my.base_relative_path)"
endfunction

function global.substitute_separator(path, prev, next)
define my.path = substitute_separator.path
define my.prev = substitute_separator.prev
define my.next = substitute_separator.next

return string.replace(my.path, '$(my.prev)|$(my.next)')
endfunction

#------------------------------------------------------------------------------
# I/O utilities.
#------------------------------------------------------------------------------
function create_directory(path)
function global.create_directory(path)
define my.result = directory.create(my.path)
if (my.result = 0)
return
endif
abort "Directory creation failure: $(error_text)"
endfunction

function global.calculated_name(file, meta)
define my.file = calculated_name.file
define my.meta = calculated_name.meta

for my.meta.match as _match where ends_with(my.file.name, _match.suffix)
if defined(_match.strip)
return string.substr(my.file.name, 0, string.length(my.file.name) - string.length(_match.strip) - 1)
endif
endfor

return my.file.name
endfunction

function global.is_targeted_file(file, meta)
define my.file = is_targeted_file.file
define my.meta = is_targeted_file.meta

define my.filterless = (count(my.meta.match) = 0)

if my.filterless
return 1
endif

for my.meta.match as _filter where defined(_filter.suffix)
if ends_with(my.file.name, _filter.suffix)
return 1
endif
endfor

return 0
endfunction

function global.discover_files(files, meta, path, recurse)
define my.files = discover_files.files
define my.meta = discover_files.meta
define my.path = discover_files.path
define my.recurse = discover_files.recurse ? 1

# meta presumed structure:
# <meta>
# <match ?suffix=suffix? ?exclude="yes/true"? />
# </meta>

define my.directory = directory.open(my.path)?

if !defined(my.directory)
abort "Directory open failure: $(error_text)"
endif

my.files.path = my.directory.path
my.files.name = my.directory.name
my.files.query = my.path

if my.recurse
for my.directory.directory as _subdirectory
new my.files.directory as _directory
discover_files(_directory, my.meta, "$(_subdirectory.path)$(_subdirectory.name)")
endnew
endfor
endif

for my.directory.file as _file by _file.name \
where is_targeted_file(_file, my.meta)

define my.modified_name = calculated_name(_file, my.meta)

#if !(my.modified_name = _file.name)
# check for redundancy, if so skip
if !(count(my.files.file, (count.name = my.modified_name)) = 0)
next
endif
#endif

new my.files.file as _active_file
_active_file.name = my.modified_name
_active_file.path = _file.path
endnew
endfor
endfunction

function global.matches_filters(filters, filename)
define my.filters = matches_filters.filters
define my.filename = matches_filters.filename

if count(my.filters.match) = 0
return 1
endif

for my.filters.match as _match
if ends_with(my.filename, _match.suffix)
return 1
endif
endfor

return 0
endfunction

function global.populate_files_from_path(path_substitutions, files, filters, files_path, absolute_path_base, intended_prefix_base)
define my.path_substitutions = populate_files_from_path.path_substitutions
define my.files = populate_files_from_path.files
define my.filters = populate_files_from_path.filters
define my.files_path = populate_files_from_path.files_path
define my.absolute_path_base = populate_files_from_path.absolute_path_base
define my.intended_prefix_base = populate_files_from_path.intended_prefix_base

define my.path = path_append(my.absolute_path_base, my.files_path.path)
define my.recurse = is_defined_positive(my.files_path, "recursive")

new my.files.directory as _directory
discover_files(_directory, my.filters, my.path, my.recurse)
endnew

new my.path_substitutions.substitution as _sub
_sub.absolute_path = my.path
_sub.relative_path_prefix = path_append(my.intended_prefix_base, \
my.files_path.path)

_sub.unprefixed_path = my.files_path.path

if defined(my.files_path->msbuild) & defined(my.files_path->msbuild.filter)
_sub.filter = my.files_path->msbuild.filter
else
_sub.filter = my.files_path.path
endif

#echo("sub absolute_path | $(_sub.absolute_path)")
#echo("sub relative_path_prefix | $(_sub.relative_path_prefix)")
#echo("sub unprefixed_path | $(_sub.unprefixed_path)")
#echo("sub filter | $(_sub.filter)")
endnew
endfunction

function global.populate_files(path_substitutions, files, filters, target, absolute_path_base, intended_prefix_base)
define my.path_substitutions = populate_files.path_substitutions
define my.files = populate_files.files
define my.filters = populate_files.filters
define my.target = populate_files.target
define my.absolute_path_base = populate_files.absolute_path_base
define my.intended_prefix_base = populate_files.intended_prefix_base

for my.target.headers as _file_path where is_defined_positive(_file_path, "root")
populate_files_from_path(my.path_substitutions, my.files, my.filters, \
_file_path, my.absolute_path_base, my.intended_prefix_base)
endfor

for my.target.sources as _file_path
populate_files_from_path(my.path_substitutions, my.files, my.filters, \
_file_path, my.absolute_path_base, my.intended_prefix_base)
endfor

for my.target.resources as _file_path
populate_files_from_path(my.path_substitutions, my.files, my.filters, \
_file_path, my.absolute_path_base, my.intended_prefix_base)
endfor

# substitution of last resort
new my.path_substitutions.substitution as _sub
_sub.absolute_path = my.absolute_path_base
_sub.relative_path_prefix = my.intended_prefix_base
endnew
endfunction

function repository_absolute_path(repository, configuration)
define my.repository = repository_absolute_path.repository
define my.configuration = repository_absolute_path.configuration

define my.path = path_append(my.configuration->templates.src_root_path, \
my.repository.name)

define my.directory = directory.open(my.path)

return my.directory.path
endfunction

.endtemplate
.template 1
.
Expand Down
59 changes: 59 additions & 0 deletions lib/msbuild.gsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
.template 0
###############################################################################
# Copyright (c) 2014-2026 libbitcoin developers (see COPYING).
#
# GSL libbitcoin msbuild utilities in the 'global' scope.
#
# This is a code generator built using the iMatix GSL code generation
# language. See https://github.com/imatix/gsl for details.
###############################################################################

###############################################################################
# Functions
###############################################################################

###############################################################################
# Specific pattern xml functions
###############################################################################
function global.target_name(target)
define my.target = target_name.target

if defined(my.target.msvcproj)
return my.target.msvcproj
endif

return my.target.name
endfunction

function global.path(input)
return string.replace(path.input, "/|\\")
endfunction

function global.project_relative_path(target, meta, tooling)
define my.target = project_relative_path.target
define my.meta = project_relative_path.meta
define my.tooling = project_relative_path.tooling

define my.relevant = target_name(my.target)
define my.path = path_append(my.relevant, "$(my.relevant).vcxproj")

if defined(my.tooling.relative_path)
my.path = path_append(my.tooling.relative_path, my.path)
endif

if defined(my.meta.relative_path)
my.path = path_append(my.meta.relative_path, my.path)
endif

return my.path
endfunction

.endtemplate
.template 1
.
.##############################################################################
.# Macros
.##############################################################################
.
.endtemplate

Loading
Loading