Skip to content

Commit fb20ae5

Browse files
authored
Merge pull request #388 from evoskuil/master
Update SSL and ICU options.
2 parents d916e81 + f7efb1c commit fb20ae5

File tree

8 files changed

+100
-21
lines changed

8 files changed

+100
-21
lines changed

generate4.xml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<option type="with" name="pkgconfigdir" default="${libdir}/pkgconfig" example="=DIR" unprefixed="true" substitute="true" description="Path to pkgconfig directory." data_type="path" />
1717
<option type="with" name="tests" default="yes" conditional="true" description="Compile with unit tests." />
1818
<option type="with" name="examples" default="yes" conditional="true" description="Compile with examples." />
19-
<option type="with" name="icu" default="no" define="BOOST_HAS_ICU" substitute="true" value="-DWITH_ICU" description="Compile with International Components for Unicode." />
19+
<option type="with" name="icu" default="no" define="WITH_ICU" substitute="true" value="-DWITH_ICU" description="Compile with International Components for Unicode." />
2020
<option type="enable" name="avx2" default="no" description="Compile with avx2 intrinsics (specifically -mavx -mavx2)." />
2121
<option type="enable" name="avx512" default="no" description="Compile with avx512 intrinsics (specifically -mavx512bw -mavx512f)." />
2222
<option type="enable" name="sse41" default="no" description="Compile with sse4.1 intrinsics (specifically -msse4.1)." />
@@ -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="WOLFSSL_USER_SETTINGS" 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: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,29 @@
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>
1729
<ClCompile>
1830
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\..\..\libbitcoin-network\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
19-
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\..\..\libbitcoin-network\include\bitcoin\ssl\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
31+
32+
<!-- Prevent boost from seeing ssl includes when ssl is deselected (requires external headers). -->
33+
<AdditionalIncludeDirectories Condition="'$(Option-ssl)' == 'true'">$(ProjectDir)..\..\..\..\..\libbitcoin-network\include\bitcoin\ssl\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
2034
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
2135
<PreprocessorDefinitions Condition="'$(Linkage-libbitcoin-network)' == 'static' Or '$(Linkage-libbitcoin-network)' == 'ltcg'">BCT_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
22-
<PreprocessorDefinitions>WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
36+
<PreprocessorDefinitions Condition="'$(Option-ssl)' == 'true'">WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
2337
</ClCompile>
2438
<Link>
2539
<AdditionalDependencies Condition="'$(Linkage-libbitcoin-network)' != ''">libbitcoin-network.lib;%(AdditionalDependencies)</AdditionalDependencies>
@@ -35,4 +49,14 @@
3549
</AdditionalLibraryDirectories>
3650
</Link>
3751
</ItemDefinitionGroup>
52+
53+
<Target Name="WolfSSLSuppressions" BeforeTargets="ClCompile">
54+
<ItemGroup>
55+
<ClCompile Update="@(ClCompile)">
56+
<!-- Exclude wolfssl test sources when ssl is deselected (requires external linkage). -->
57+
<ExcludedFromBuild Condition="$([System.String]::new('%(RelativeDir)').StartsWith('..\..\..\..\test\ssl\')) And '$(Option-ssl)' == 'false'">true</ExcludedFromBuild>
58+
</ClCompile>
59+
</ItemGroup>
60+
</Target>
61+
3862
</Project>

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/import/libbitcoin-system.import.props

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,9 @@
4646
<ItemDefinitionGroup>
4747
<ClCompile>
4848
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\..\..\libbitcoin-system\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
49-
<!-- WITH_ICU always defined in Visual Studio builds. -->
5049
<!-- NOMINMAX enables use of std::min/max without conflict. -->
5150
<!-- WIN32_LEAN_AND_MEAN avoids inclusion of certain headers, winsock.h conflicts with boost and protocol use of winsock2.h. -->
52-
<PreprocessorDefinitions>WITH_ICU;WIN32_LEAN_AND_MEAN;NOMINMAX;_WIN32_WINNT=0x0602;%(PreprocessorDefinitions)</PreprocessorDefinitions>
53-
<!-- Disable auto-linking for all boost-json and its dependency boost-container so they can be header only. -->
54-
<PreprocessorDefinitions>BOOST_JSON_NO_LIB;BOOST_CONTAINER_NO_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
51+
<PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;NOMINMAX;_WIN32_WINNT=0x0602;%(PreprocessorDefinitions)</PreprocessorDefinitions>
5552
<PreprocessorDefinitions Condition="'$(Linkage-libbitcoin-system)' == 'static' Or '$(Linkage-libbitcoin-system)' == 'ltcg'">BC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
5653
<PreprocessorDefinitions Condition="$(Configuration.IndexOf('Debug')) != -1">_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
5754
<!-- Enable use of CPU intrinsics. -->

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,16 @@
1313
<ClCompile>
1414
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\..\..\libbitcoin-network\test\ssl\wolfssl\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
1515
<EnablePREfast>false</EnablePREfast>
16-
<PreprocessorDefinitions>CERT_PREFIX=&quot;$(RepoRoot.Replace("\", "/"))test/ssl/vectors/&quot;;%(PreprocessorDefinitions)</PreprocessorDefinitions>
16+
17+
<!-- Define CERT_PREFIX as the relative path to the /certs and /tests parent directory. -->
18+
<PreprocessorDefinitions Condition="'$(Option-ssl)' == 'true'">CERT_PREFIX=&quot;$(RepoRoot.Replace("\", "/"))test/ssl/vectors/&quot;;%(PreprocessorDefinitions)</PreprocessorDefinitions>
1719
</ClCompile>
1820
<PostBuildEvent Condition="'$(DebugOrRelease)' == 'release'">
1921
<Command>"$(TargetPath)" --log_level=warning --run_test=* --show_progress=no --build_info=yes</Command>
2022
</PostBuildEvent>
2123
</ItemDefinitionGroup>
2224

23-
<Target Name="SuppressWarningsForWolfSSLFiles" BeforeTargets="ClCompile">
25+
<Target Name="WolfSSLSuppressions" BeforeTargets="ClCompile">
2426
<ItemGroup>
2527
<ClCompile Update="@(ClCompile)">
2628
<AdditionalOptions Condition="$([System.String]::new('%(RelativeDir)').StartsWith('..\..\..\..\test\ssl\wolfssl\'))">/wd4005 /wd4189 /wd4245 /wd4267 /wd4701 /wd4702 /wd4703 %(AdditionalOptions)</AdditionalOptions>

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

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,44 @@
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>
1325
<ClCompile>
1426
<AdditionalIncludeDirectories>$(RepoRoot)include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
15-
<AdditionalIncludeDirectories>$(RepoRoot)include\bitcoin\ssl\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
27+
28+
<!-- Prevent boost from seeing ssl includes when ssl is deselected (requires external headers). -->
29+
<AdditionalIncludeDirectories Condition="'$(Option-ssl)' == 'true'">$(RepoRoot)include\bitcoin\ssl\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
1630
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
1731
<EnablePREfast>false</EnablePREfast>
1832
<PreprocessorDefinitions Condition="'$(ConfigurationType)' == 'DynamicLibrary'">BCT_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
1933
<PreprocessorDefinitions Condition="'$(ConfigurationType)' == 'StaticLibrary'">BCT_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
20-
<PreprocessorDefinitions>WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
34+
<PreprocessorDefinitions Condition="'$(Option-ssl)' == 'true'">WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
2135
</ClCompile>
2236
</ItemDefinitionGroup>
2337

24-
<Target Name="SuppressWarningsForWolfSSLFiles" BeforeTargets="ClCompile">
38+
<Target Name="WolfSSLSuppressions" BeforeTargets="ClCompile">
2539
<ItemGroup>
2640
<ClCompile Update="@(ClCompile)">
2741
<AdditionalOptions Condition="$([System.String]::new('%(RelativeDir)').StartsWith('..\..\..\..\src\ssl\'))">/wd4189 /wd4245 /wd4267 /wd4701 /wd4702 /wd4703 %(AdditionalOptions)</AdditionalOptions>
42+
43+
<!-- This is only used as an inlining header, so never compile it directly. -->
44+
<ExcludedFromBuild Condition="$([System.String]::new('%(RelativeDir)').StartsWith('..\..\..\..\include\bitcoin\ssl\'))">true</ExcludedFromBuild>
45+
46+
<!-- Exclude wolfssl sources when ssl is deselected (requires external linkage). -->
47+
<ExcludedFromBuild Condition="$([System.String]::new('%(RelativeDir)').StartsWith('..\..\..\..\include\bitcoin\ssl\wolfcrypt\src\')) And '$(Option-ssl)' == 'false'">true</ExcludedFromBuild>
2848
</ClCompile>
2949
</ItemGroup>
3050
</Target>
@@ -51,9 +71,19 @@
5171
<Linkage-secp256k1>static</Linkage-secp256k1>
5272
<Linkage-libbitcoin-system>static</Linkage-libbitcoin-system>
5373
</PropertyGroup>
74+
75+
<!-- Options -->
5476

77+
<PropertyGroup>
78+
<Option-ssl>true</Option-ssl>
79+
</PropertyGroup>
80+
5581
<!-- Messages -->
5682

83+
<Target Name="OptionInfo" BeforeTargets="PrepareForBuild">
84+
<Message Text="Option-ssl : $(Option-ssl)" Importance="high"/>
85+
</Target>
86+
5787
<Target Name="LinkageInfo" BeforeTargets="PrepareForBuild">
5888
<Message Text="Linkage-secp256k1 : $(Linkage-secp256k1)" Importance="high"/>
5989
<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>

props/version4/project/libbitcoin-system/libbitcoin-system/libbitcoin-system.props

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,9 @@
1919
<ClCompile>
2020
<AdditionalIncludeDirectories>$(RepoRoot)include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
2121
<EnablePREfast>false</EnablePREfast>
22-
<!-- WITH_ICU always defined in Visual Studio builds. -->
2322
<!-- NOMINMAX enables use of std::min/max without conflict. -->
2423
<!-- WIN32_LEAN_AND_MEAN avoids inclusion of certain headers, winsock.h conflicts with boost and protocol use of winsock2.h. -->
25-
<PreprocessorDefinitions>WITH_ICU;WIN32_LEAN_AND_MEAN;NOMINMAX;_WIN32_WINNT=0x0600;%(PreprocessorDefinitions)</PreprocessorDefinitions>
26-
<!-- Disable auto-linking for all boost-json and its dependency boost-container so they can be header only. -->
27-
<PreprocessorDefinitions>BOOST_JSON_NO_LIB;BOOST_CONTAINER_NO_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
24+
<PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;NOMINMAX;_WIN32_WINNT=0x0600;%(PreprocessorDefinitions)</PreprocessorDefinitions>
2825
<PreprocessorDefinitions Condition="'$(ConfigurationType)' == 'DynamicLibrary'">BC_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
2926
<PreprocessorDefinitions Condition="'$(ConfigurationType)' == 'StaticLibrary'">BC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
3027
<PreprocessorDefinitions Condition="$(Configuration.IndexOf('Debug')) != -1">_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>

0 commit comments

Comments
 (0)