aboutsummaryrefslogtreecommitdiff
path: root/build_msvc
diff options
context:
space:
mode:
Diffstat (limited to 'build_msvc')
-rw-r--r--build_msvc/bitcoind/bitcoind.vcxproj26
-rw-r--r--build_msvc/common.init.vcxproj1
-rw-r--r--build_msvc/msbuild/tasks/replaceinfile.targets35
3 files changed, 62 insertions, 0 deletions
diff --git a/build_msvc/bitcoind/bitcoind.vcxproj b/build_msvc/bitcoind/bitcoind.vcxproj
index 2c5dde3015..c5cddfdbb2 100644
--- a/build_msvc/bitcoind/bitcoind.vcxproj
+++ b/build_msvc/bitcoind/bitcoind.vcxproj
@@ -45,4 +45,30 @@
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <Import Label="ReplaceInFile" Project="..\msbuild\tasks\replaceinfile.targets" />
+ <PropertyGroup>
+ <ConfigIniIn>..\..\test\config.ini.in</ConfigIniIn>
+ <ConfigIniOut>..\..\test\config.ini</ConfigIniOut>
+ </PropertyGroup>
+ <Target Name="AfterBuild">
+ <Copy SourceFiles="$(ConfigIniIn)" DestinationFiles="$(ConfigIniOut)" ></Copy>
+ <ReplaceInFile FilePath="$(ConfigIniOut)"
+ Replace="@PACKAGE_NAME@" By="Bitcoin Core"></ReplaceInFile>
+ <ReplaceInFile FilePath="$(ConfigIniOut)"
+ Replace="@abs_top_srcdir@" By="..\.." ToFullPath="true"></ReplaceInFile>
+ <ReplaceInFile FilePath="$(ConfigIniOut)"
+ Replace="@abs_top_builddir@" By="..\.." ToFullPath="true"></ReplaceInFile>
+ <ReplaceInFile FilePath="$(ConfigIniOut)"
+ Replace="@EXEEXT@" By=".exe"></ReplaceInFile>
+ <ReplaceInFile FilePath="$(ConfigIniOut)"
+ Replace="@ENABLE_WALLET_TRUE@" By=""></ReplaceInFile>
+ <ReplaceInFile FilePath="$(ConfigIniOut)"
+ Replace="@BUILD_BITCOIN_CLI_TRUE@" By=""></ReplaceInFile>
+ <ReplaceInFile FilePath="$(ConfigIniOut)"
+ Replace="@BUILD_BITCOIND_TRUE@" By=""></ReplaceInFile>
+ <ReplaceInFile FilePath="$(ConfigIniOut)"
+ Replace="@ENABLE_FUZZ_TRUE@" By=""></ReplaceInFile>
+ <ReplaceInFile FilePath="$(ConfigIniOut)"
+ Replace="@ENABLE_ZMQ_TRUE@" By=""></ReplaceInFile>
+ </Target>
</Project>
diff --git a/build_msvc/common.init.vcxproj b/build_msvc/common.init.vcxproj
index 8b6217e2b0..f08ac78b21 100644
--- a/build_msvc/common.init.vcxproj
+++ b/build_msvc/common.init.vcxproj
@@ -115,4 +115,5 @@
<AdditionalDependencies>crypt32.lib;Iphlpapi.lib;ws2_32.lib;Shlwapi.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
+ <Import Project="common.init.vcxproj.user" Condition="Exists('common.init.vcxproj.user')" />
</Project>
diff --git a/build_msvc/msbuild/tasks/replaceinfile.targets b/build_msvc/msbuild/tasks/replaceinfile.targets
new file mode 100644
index 0000000000..2ccb8b30e0
--- /dev/null
+++ b/build_msvc/msbuild/tasks/replaceinfile.targets
@@ -0,0 +1,35 @@
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <UsingTask
+ TaskName="ReplaceInFile"
+ TaskFactory="CodeTaskFactory"
+ AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll" >
+ <ParameterGroup>
+ <FilePath Required="true" />
+ <Replace Required="true" />
+ <By Required="false" />
+ <ToFullPath Required="false" />
+ </ParameterGroup>
+ <Task>
+ <Using Namespace="System"/>
+ <Using Namespace="System.IO"/>
+ <Code Type="Fragment" Language="cs">
+<![CDATA[
+if(File.Exists(FilePath) == false) {
+ Log.LogError("replaceinfile task could not locate " + FilePath + ".");
+}
+else {
+ var data = File.ReadAllText(FilePath);
+ var by = By;
+ if (ToFullPath == "true")
+ {
+ by = Path.GetFullPath(by);
+ }
+ data = data.Replace(Replace, by);
+ Log.LogMessage("Replace '" + Replace + "' by '" + by + "' in " + FilePath);
+ File.WriteAllText(FilePath, data, new System.Text.UTF8Encoding(false));
+}
+]]>
+ </Code>
+ </Task>
+ </UsingTask>
+</Project> \ No newline at end of file