Skip to content

Commit bd611d5

Browse files
committed
Add ssl option, move WOLFSSL_USER_SETTINGS define into source.
1 parent a7458d5 commit bd611d5

File tree

5 files changed

+70
-7
lines changed

5 files changed

+70
-7
lines changed

generate4.xml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -339,17 +339,17 @@
339339

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

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

344346
<configure>
345347
<option type="with" name="pkgconfigdir" default="${libdir}/pkgconfig" example="=DIR" unprefixed="true" substitute="true" description="Path to pkgconfig directory." data_type="path" />
346348
<option type="with" name="tests" default="yes" conditional="true" description="Compile with unit tests." />
349+
<option type="with" name="ssl" default="yes" define="WITH_SSL" substitute="true" value="-DWOLFSSL_USER_SETTINGS" description="Compile with internal ssl." />
347350
<option type="enable" name="ndebug" default="yes" define="NDEBUG" description="Compile without debug assertions." />
348351
<option type="enable" name="shared" default="yes" define="BOOST_ALL_DYN_LINK" inherited="true" description="Required for dynamically linking boost test." />
349352

350-
<!-- WOLFSSL_USER_SETTINGS causes import of "user_settings.h". -->
351-
<define name="WOLFSSL_USER_SETTINGS"/>
352-
353353
<dependency name="boost" version="1.86.0" />
354354
<dependency name="boost_unit_test_framework" option="tests" />
355355
<dependency name="bitcoin-system" version="4.0.0" />
@@ -393,6 +393,7 @@
393393
<product prefix="lib" path="src" uuid="564eb540-d6b6-425c-b8db-b0bee8970c18" >
394394
<library name="bitcoin-system" />
395395
<headers path="include" />
396+
<!-- TODO: exclude if WITH_SSL not defined -->
396397
<headers path="include/bitcoin/ssl" />
397398
<sources path="src" />
398399
</product>
@@ -404,7 +405,9 @@
404405
<library name="bitcoin-network" />
405406
<library name="boost_unit_test_framework" />
406407
<headers path="include" />
408+
<!-- TODO: exclude if WITH_SSL not defined -->
407409
<headers path="include/bitcoin/ssl" />
410+
<!-- TODO: exclude if WITH_SSL not defined -->
408411
<headers path="test/ssl/wolfssl" />
409412
<sources path="test" />
410413
</product>
@@ -1587,7 +1590,6 @@
15871590
<dependency name="boost" version="1.86.0" />
15881591
<dependency name="boost_unit_test_framework" option="tests" />
15891592
<dependency name="bash-completion" version="2.0.0" option="bash-completiondir" unprefixed="true" extract="completionsdir" default="${datadir}/bash-completion/completions" />
1590-
15911593
<dependency name="bitcoin-node" version="4.0.0" />
15921594

15931595
<!-- General flags -->

props/version4/import/libbitcoin-network.import.props

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,18 @@
1111
<PropertyPageSchema Include="$(MSBuildThisFileDirectory)libbitcoin-network.import.xml" />
1212
</ItemGroup>
1313

14+
<!-- Options -->
15+
16+
<PropertyGroup>
17+
<Option-ssl>true</Option-ssl>
18+
</PropertyGroup>
19+
20+
<!-- Messages -->
21+
22+
<Target Name="OptionInfo" BeforeTargets="PrepareForBuild">
23+
<Message Text="Option-ssl : $(Option-ssl)" Importance="high"/>
24+
</Target>
25+
1426
<!-- Linkage -->
1527

1628
<ItemDefinitionGroup>
@@ -19,7 +31,7 @@
1931
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\..\..\libbitcoin-network\include\bitcoin\ssl\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
2032
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
2133
<PreprocessorDefinitions Condition="'$(Linkage-libbitcoin-network)' == 'static' Or '$(Linkage-libbitcoin-network)' == 'ltcg'">BCT_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
22-
<PreprocessorDefinitions>WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
34+
<PreprocessorDefinitions Condition="'$(Option-ssl)' == 'true'">WITH_SSL;WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
2335
</ClCompile>
2436
<Link>
2537
<AdditionalDependencies Condition="'$(Linkage-libbitcoin-network)' != ''">libbitcoin-network.lib;%(AdditionalDependencies)</AdditionalDependencies>

props/version4/import/libbitcoin-network.import.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,16 @@
1414
<EnumValue Name="ltcg" DisplayName="Static using link time compile generation (LTCG)" />
1515
</EnumProperty>
1616
</Rule>
17+
<Rule Name="libbitcoin-network-options-uiextension" PageTemplate="tool" DisplayName="Bitcoin Network Options" SwitchPrefix="/" Order="1">
18+
<Rule.Categories>
19+
<Category Name="ssl" DisplayName="ssl" />
20+
</Rule.Categories>
21+
<Rule.DataSource>
22+
<DataSource Persistence="ProjectFile" ItemType="" />
23+
</Rule.DataSource>
24+
<EnumProperty Name="Option-ssl" DisplayName="Enable Embedded SSL" Description="Requires external SSL if not enabled." Category="ssl">
25+
<EnumValue Name="false" DisplayName="No" />
26+
<EnumValue Name="true" DisplayName="Yes" />
27+
</EnumProperty>
28+
</Rule>
1729
</ProjectSchemaDefinitions>

props/version4/project/libbitcoin-network/libbitcoin-network/libbitcoin-network.props

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,18 @@
77
<RunCodeAnalysis>false</RunCodeAnalysis>
88
</PropertyGroup>
99

10+
<!-- User Interface -->
11+
12+
<ItemGroup Label="BuildOptionsExtension">
13+
<PropertyPageSchema Include="$(MSBuildThisFileDirectory)$(ProjectName).xml" />
14+
</ItemGroup>
15+
16+
<!-- Options -->
17+
18+
<PropertyGroup>
19+
<Option-ssl>true</Option-ssl>
20+
</PropertyGroup>
21+
1022
<!-- Configuration -->
1123

1224
<ItemDefinitionGroup>
@@ -17,7 +29,7 @@
1729
<EnablePREfast>false</EnablePREfast>
1830
<PreprocessorDefinitions Condition="'$(ConfigurationType)' == 'DynamicLibrary'">BCT_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
1931
<PreprocessorDefinitions Condition="'$(ConfigurationType)' == 'StaticLibrary'">BCT_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
20-
<PreprocessorDefinitions>WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
32+
<PreprocessorDefinitions Condition="'$(Option-ssl)' == 'true'">WITH_SSL;WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
2133
</ClCompile>
2234
</ItemDefinitionGroup>
2335

@@ -51,9 +63,19 @@
5163
<Linkage-secp256k1>static</Linkage-secp256k1>
5264
<Linkage-libbitcoin-system>static</Linkage-libbitcoin-system>
5365
</PropertyGroup>
66+
67+
<!-- Options -->
5468

69+
<PropertyGroup>
70+
<Option-ssl>true</Option-ssl>
71+
</PropertyGroup>
72+
5573
<!-- Messages -->
5674

75+
<Target Name="OptionInfo" BeforeTargets="PrepareForBuild">
76+
<Message Text="Option-ssl : $(Option-ssl)" Importance="high"/>
77+
</Target>
78+
5779
<Target Name="LinkageInfo" BeforeTargets="PrepareForBuild">
5880
<Message Text="Linkage-secp256k1 : $(Linkage-secp256k1)" Importance="high"/>
5981
<Message Text="Linkage-_system : $(Linkage-libbitcoin-system)" Importance="high"/>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<ProjectSchemaDefinitions xmlns="clr-namespace:Microsoft.Build.Framework.XamlTypes;assembly=Microsoft.Build.Framework">
3+
<Rule Name="libbitcoin-network-uiextension" PageTemplate="tool" DisplayName="Bitcoin Network Options" SwitchPrefix="/" Order="1">
4+
<Rule.Categories>
5+
<Category Name="ssl" DisplayName="ssl" />
6+
</Rule.Categories>
7+
<Rule.DataSource>
8+
<DataSource Persistence="ProjectFile" ItemType="" />
9+
</Rule.DataSource>
10+
<EnumProperty Name="Option-ssl" DisplayName="Enable Embedded SSL" Description="Requires external SSL if not enabled." Category="ssl">
11+
<EnumValue Name="false" DisplayName="No" />
12+
<EnumValue Name="true" DisplayName="Yes" />
13+
</EnumProperty>
14+
</Rule>
15+
</ProjectSchemaDefinitions>

0 commit comments

Comments
 (0)