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
14 changes: 8 additions & 6 deletions generate4.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<option type="with" name="pkgconfigdir" default="${libdir}/pkgconfig" example="=DIR" unprefixed="true" substitute="true" description="Path to pkgconfig directory." data_type="path" />
<option type="with" name="tests" default="yes" conditional="true" description="Compile with unit tests." />
<option type="with" name="examples" default="yes" conditional="true" description="Compile with examples." />
<option type="with" name="icu" default="no" define="BOOST_HAS_ICU" substitute="true" value="-DWITH_ICU" description="Compile with International Components for Unicode." />
<option type="with" name="icu" default="no" define="WITH_ICU" substitute="true" value="-DWITH_ICU" description="Compile with International Components for Unicode." />
<option type="enable" name="avx2" default="no" description="Compile with avx2 intrinsics (specifically -mavx -mavx2)." />
<option type="enable" name="avx512" default="no" description="Compile with avx512 intrinsics (specifically -mavx512bw -mavx512f)." />
<option type="enable" name="sse41" default="no" description="Compile with sse4.1 intrinsics (specifically -msse4.1)." />
Expand Down Expand Up @@ -339,17 +339,17 @@

<repository name="libbitcoin-network" version="4.0.0" email="eric@voskuil.org" >

<package library="bitcoin-network" description="Bitcoin P2P Network Library" url="https://github.com/libbitcoin/libbitcoin-network" />
<package library="bitcoin-network" description="Bitcoin P2P Network Library" url="https://github.com/libbitcoin/libbitcoin-network" >
<flag value="@ssl@" />
</package>

<configure>
<option type="with" name="pkgconfigdir" default="${libdir}/pkgconfig" example="=DIR" unprefixed="true" substitute="true" description="Path to pkgconfig directory." data_type="path" />
<option type="with" name="tests" default="yes" conditional="true" description="Compile with unit tests." />
<option type="with" name="ssl" default="yes" define="WOLFSSL_USER_SETTINGS" substitute="true" value="-DWOLFSSL_USER_SETTINGS" description="Compile with internal ssl." />
<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." />

<!-- WOLFSSL_USER_SETTINGS causes import of "user_settings.h". -->
<define name="WOLFSSL_USER_SETTINGS"/>

<dependency name="boost" version="1.86.0" />
<dependency name="boost_unit_test_framework" option="tests" />
<dependency name="bitcoin-system" version="4.0.0" />
Expand Down Expand Up @@ -393,6 +393,7 @@
<product prefix="lib" path="src" uuid="564eb540-d6b6-425c-b8db-b0bee8970c18" >
<library name="bitcoin-system" />
<headers path="include" />
<!-- TODO: exclude if WITH_SSL not defined -->
<headers path="include/bitcoin/ssl" />
<sources path="src" />
</product>
Expand All @@ -404,7 +405,9 @@
<library name="bitcoin-network" />
<library name="boost_unit_test_framework" />
<headers path="include" />
<!-- TODO: exclude if WITH_SSL not defined -->
<headers path="include/bitcoin/ssl" />
<!-- TODO: exclude if WITH_SSL not defined -->
<headers path="test/ssl/wolfssl" />
<sources path="test" />
</product>
Expand Down Expand Up @@ -1587,7 +1590,6 @@
<dependency name="boost" version="1.86.0" />
<dependency name="boost_unit_test_framework" option="tests" />
<dependency name="bash-completion" version="2.0.0" option="bash-completiondir" unprefixed="true" extract="completionsdir" default="${datadir}/bash-completion/completions" />

<dependency name="bitcoin-node" version="4.0.0" />

<!-- General flags -->
Expand Down
28 changes: 26 additions & 2 deletions props/version4/import/libbitcoin-network.import.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,29 @@
<PropertyPageSchema Include="$(MSBuildThisFileDirectory)libbitcoin-network.import.xml" />
</ItemGroup>

<!-- Options -->

<PropertyGroup>
<Option-ssl>true</Option-ssl>
</PropertyGroup>

<!-- Messages -->

<Target Name="OptionInfo" BeforeTargets="PrepareForBuild">
<Message Text="Option-ssl : $(Option-ssl)" Importance="high"/>
</Target>

<!-- Linkage -->

<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\..\..\libbitcoin-network\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\..\..\libbitcoin-network\include\bitcoin\ssl\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>

<!-- Prevent boost from seeing ssl includes when ssl is deselected (requires external headers). -->
<AdditionalIncludeDirectories Condition="'$(Option-ssl)' == 'true'">$(ProjectDir)..\..\..\..\..\libbitcoin-network\include\bitcoin\ssl\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
<PreprocessorDefinitions Condition="'$(Linkage-libbitcoin-network)' == 'static' Or '$(Linkage-libbitcoin-network)' == 'ltcg'">BCT_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Option-ssl)' == 'true'">WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<AdditionalDependencies Condition="'$(Linkage-libbitcoin-network)' != ''">libbitcoin-network.lib;%(AdditionalDependencies)</AdditionalDependencies>
Expand All @@ -35,4 +49,14 @@
</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>

<Target Name="WolfSSLSuppressions" BeforeTargets="ClCompile">
<ItemGroup>
<ClCompile Update="@(ClCompile)">
<!-- Exclude wolfssl test sources when ssl is deselected (requires external linkage). -->
<ExcludedFromBuild Condition="$([System.String]::new('%(RelativeDir)').StartsWith('..\..\..\..\test\ssl\')) And '$(Option-ssl)' == 'false'">true</ExcludedFromBuild>
</ClCompile>
</ItemGroup>
</Target>

</Project>
12 changes: 12 additions & 0 deletions props/version4/import/libbitcoin-network.import.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,16 @@
<EnumValue Name="ltcg" DisplayName="Static using link time compile generation (LTCG)" />
</EnumProperty>
</Rule>
<Rule Name="libbitcoin-network-options-uiextension" PageTemplate="tool" DisplayName="Bitcoin Network Options" SwitchPrefix="/" Order="1">
<Rule.Categories>
<Category Name="ssl" DisplayName="ssl" />
</Rule.Categories>
<Rule.DataSource>
<DataSource Persistence="ProjectFile" ItemType="" />
</Rule.DataSource>
<EnumProperty Name="Option-ssl" DisplayName="Enable Embedded SSL" Description="Requires external SSL if not enabled." Category="ssl">
<EnumValue Name="false" DisplayName="No" />
<EnumValue Name="true" DisplayName="Yes" />
</EnumProperty>
</Rule>
</ProjectSchemaDefinitions>
5 changes: 1 addition & 4 deletions props/version4/import/libbitcoin-system.import.props
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,9 @@
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\..\..\libbitcoin-system\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<!-- WITH_ICU always defined in Visual Studio builds. -->
<!-- NOMINMAX enables use of std::min/max without conflict. -->
<!-- WIN32_LEAN_AND_MEAN avoids inclusion of certain headers, winsock.h conflicts with boost and protocol use of winsock2.h. -->
<PreprocessorDefinitions>WITH_ICU;WIN32_LEAN_AND_MEAN;NOMINMAX;_WIN32_WINNT=0x0602;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<!-- Disable auto-linking for all boost-json and its dependency boost-container so they can be header only. -->
<PreprocessorDefinitions>BOOST_JSON_NO_LIB;BOOST_CONTAINER_NO_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;NOMINMAX;_WIN32_WINNT=0x0602;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Linkage-libbitcoin-system)' == 'static' Or '$(Linkage-libbitcoin-system)' == 'ltcg'">BC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="$(Configuration.IndexOf('Debug')) != -1">_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<!-- Enable use of CPU intrinsics. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\..\..\libbitcoin-network\test\ssl\wolfssl\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<EnablePREfast>false</EnablePREfast>
<PreprocessorDefinitions>CERT_PREFIX=&quot;$(RepoRoot.Replace("\", "/"))test/ssl/vectors/&quot;;%(PreprocessorDefinitions)</PreprocessorDefinitions>

<!-- Define CERT_PREFIX as the relative path to the /certs and /tests parent directory. -->
<PreprocessorDefinitions Condition="'$(Option-ssl)' == 'true'">CERT_PREFIX=&quot;$(RepoRoot.Replace("\", "/"))test/ssl/vectors/&quot;;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<PostBuildEvent Condition="'$(DebugOrRelease)' == 'release'">
<Command>"$(TargetPath)" --log_level=warning --run_test=* --show_progress=no --build_info=yes</Command>
</PostBuildEvent>
</ItemDefinitionGroup>

<Target Name="SuppressWarningsForWolfSSLFiles" BeforeTargets="ClCompile">
<Target Name="WolfSSLSuppressions" BeforeTargets="ClCompile">
<ItemGroup>
<ClCompile Update="@(ClCompile)">
<AdditionalOptions Condition="$([System.String]::new('%(RelativeDir)').StartsWith('..\..\..\..\test\ssl\wolfssl\'))">/wd4005 /wd4189 /wd4245 /wd4267 /wd4701 /wd4702 /wd4703 %(AdditionalOptions)</AdditionalOptions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,44 @@
<RunCodeAnalysis>false</RunCodeAnalysis>
</PropertyGroup>

<!-- User Interface -->

<ItemGroup Label="BuildOptionsExtension">
<PropertyPageSchema Include="$(MSBuildThisFileDirectory)$(ProjectName).xml" />
</ItemGroup>

<!-- Options -->

<PropertyGroup>
<Option-ssl>true</Option-ssl>
</PropertyGroup>

<!-- Configuration -->

<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(RepoRoot)include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(RepoRoot)include\bitcoin\ssl\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>

<!-- Prevent boost from seeing ssl includes when ssl is deselected (requires external headers). -->
<AdditionalIncludeDirectories Condition="'$(Option-ssl)' == 'true'">$(RepoRoot)include\bitcoin\ssl\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
<EnablePREfast>false</EnablePREfast>
<PreprocessorDefinitions Condition="'$(ConfigurationType)' == 'DynamicLibrary'">BCT_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(ConfigurationType)' == 'StaticLibrary'">BCT_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Option-ssl)' == 'true'">WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>

<Target Name="SuppressWarningsForWolfSSLFiles" BeforeTargets="ClCompile">
<Target Name="WolfSSLSuppressions" BeforeTargets="ClCompile">
<ItemGroup>
<ClCompile Update="@(ClCompile)">
<AdditionalOptions Condition="$([System.String]::new('%(RelativeDir)').StartsWith('..\..\..\..\src\ssl\'))">/wd4189 /wd4245 /wd4267 /wd4701 /wd4702 /wd4703 %(AdditionalOptions)</AdditionalOptions>

<!-- This is only used as an inlining header, so never compile it directly. -->
<ExcludedFromBuild Condition="$([System.String]::new('%(RelativeDir)').StartsWith('..\..\..\..\include\bitcoin\ssl\'))">true</ExcludedFromBuild>

<!-- Exclude wolfssl sources when ssl is deselected (requires external linkage). -->
<ExcludedFromBuild Condition="$([System.String]::new('%(RelativeDir)').StartsWith('..\..\..\..\include\bitcoin\ssl\wolfcrypt\src\')) And '$(Option-ssl)' == 'false'">true</ExcludedFromBuild>
</ClCompile>
</ItemGroup>
</Target>
Expand All @@ -51,9 +71,19 @@
<Linkage-secp256k1>static</Linkage-secp256k1>
<Linkage-libbitcoin-system>static</Linkage-libbitcoin-system>
</PropertyGroup>

<!-- Options -->

<PropertyGroup>
<Option-ssl>true</Option-ssl>
</PropertyGroup>

<!-- Messages -->

<Target Name="OptionInfo" BeforeTargets="PrepareForBuild">
<Message Text="Option-ssl : $(Option-ssl)" Importance="high"/>
</Target>

<Target Name="LinkageInfo" BeforeTargets="PrepareForBuild">
<Message Text="Linkage-secp256k1 : $(Linkage-secp256k1)" Importance="high"/>
<Message Text="Linkage-_system : $(Linkage-libbitcoin-system)" Importance="high"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<ProjectSchemaDefinitions xmlns="clr-namespace:Microsoft.Build.Framework.XamlTypes;assembly=Microsoft.Build.Framework">
<Rule Name="libbitcoin-network-uiextension" PageTemplate="tool" DisplayName="Bitcoin Network Options" SwitchPrefix="/" Order="1">
<Rule.Categories>
<Category Name="ssl" DisplayName="ssl" />
</Rule.Categories>
<Rule.DataSource>
<DataSource Persistence="ProjectFile" ItemType="" />
</Rule.DataSource>
<EnumProperty Name="Option-ssl" DisplayName="Enable Embedded SSL" Description="Requires external SSL if not enabled." Category="ssl">
<EnumValue Name="false" DisplayName="No" />
<EnumValue Name="true" DisplayName="Yes" />
</EnumProperty>
</Rule>
</ProjectSchemaDefinitions>
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,9 @@
<ClCompile>
<AdditionalIncludeDirectories>$(RepoRoot)include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<EnablePREfast>false</EnablePREfast>
<!-- WITH_ICU always defined in Visual Studio builds. -->
<!-- NOMINMAX enables use of std::min/max without conflict. -->
<!-- WIN32_LEAN_AND_MEAN avoids inclusion of certain headers, winsock.h conflicts with boost and protocol use of winsock2.h. -->
<PreprocessorDefinitions>WITH_ICU;WIN32_LEAN_AND_MEAN;NOMINMAX;_WIN32_WINNT=0x0600;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<!-- Disable auto-linking for all boost-json and its dependency boost-container so they can be header only. -->
<PreprocessorDefinitions>BOOST_JSON_NO_LIB;BOOST_CONTAINER_NO_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;NOMINMAX;_WIN32_WINNT=0x0600;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(ConfigurationType)' == 'DynamicLibrary'">BC_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(ConfigurationType)' == 'StaticLibrary'">BC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="$(Configuration.IndexOf('Debug')) != -1">_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
Expand Down
Loading