mirror of
https://github.com/nestriness/cdc-file-transfer.git
synced 2026-01-30 10:35:37 +02:00
Releasing the former Stadia file transfer tools
The tools allow efficient and fast synchronization of large directory trees from a Windows workstation to a Linux target machine. cdc_rsync* support efficient copy of files by using content-defined chunking (CDC) to identify chunks within files that can be reused. asset_stream_manager + cdc_fuse_fs support efficient streaming of a local directory to a remote virtual file system based on FUSE. It also employs CDC to identify and reuse unchanged data chunks.
This commit is contained in:
60
NMakeBazelProject.targets
Normal file
60
NMakeBazelProject.targets
Normal file
@@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<!-- Adds support for building Bazel projects as Visual Studio NMake projects.
|
||||
Works for both x64 and GGP platforms.
|
||||
|
||||
Usage: Define 4 properties in your project file:
|
||||
BazelTargets: Labels of Bazel targets to build, e.g. //common:status.
|
||||
BazelOutputFile: Output filename, e.g. cdc_rsync.exe
|
||||
BazelSourcePathPrefix: Prefix for source paths, to translate paths relative to (/foo) to project-relative paths (../foo).
|
||||
Must be escaped for sed (e.g. / -> \/), e.g. ..\/..\/..\/
|
||||
Optionally, define:
|
||||
BazelIncludePaths: Include paths, used for Intellisense.
|
||||
Import NMakeCMakeProject.targets. -->
|
||||
|
||||
<!-- Check whether all properties are defined. -->
|
||||
<Target Name="CheckProperties" BeforeTargets="PrepareForNMakeBuild">
|
||||
<Error Condition="'$(BazelTargets)' == ''" Text="Please define property BazelTargets" />
|
||||
<Error Condition="'$(BazelOutputFile)' == ''" Text="Please define property BazelOutputFile" />
|
||||
<Error Condition="'$(BazelSourcePathPrefix)' == ''" Text="Please define property BazelSourcePathPrefix" />
|
||||
</Target>
|
||||
|
||||
<!-- Define Bazel properties. -->
|
||||
<PropertyGroup>
|
||||
<BazelPlatform Condition="'$(Platform)'=='x64'">windows</BazelPlatform>
|
||||
<BazelPlatform Condition="'$(Platform)'=='GGP'">ggp_windows</BazelPlatform>
|
||||
<BazelPlatformDir Condition="'$(Platform)'=='x64'">x64-windows</BazelPlatformDir>
|
||||
<BazelPlatformDir Condition="'$(Platform)'=='GGP'">k8</BazelPlatformDir>
|
||||
<BazelCompilationMode Condition="'$(Configuration)'=='Debug'">dbg</BazelCompilationMode>
|
||||
<BazelCompilationMode Condition="'$(Configuration)'=='Release'">opt</BazelCompilationMode>
|
||||
<!-- The sed command converts repo-relative paths (/path/to/foo) to project-relative paths (../path/to/foo), so that errors etc. can be clicked in VS.
|
||||
Matches foo:31:8: bar, foo(31): bar, foo(31,32): bar -->
|
||||
<BazelSedCommand>| sed -r "s/^([^:\(]+[:\(][[:digit:]]+(,[[:digit:]]+)?[:\)])/$(BazelSourcePathPrefix)\\1/"</BazelSedCommand>
|
||||
<!-- Clang prints errors to stderr, so pipe it into stdout. -->
|
||||
<BazelSedCommand Condition="'$(Platform)'=='GGP'">2>&1 $(BazelSedCommand)</BazelSedCommand>
|
||||
<!-- The workspace_status_command saves about 8 seconds. "exit 0" is roughly equivalent to 'true'. -->
|
||||
<BazelArgs>--config=$(BazelPlatform) --workspace_status_command="exit 0" --bes_backend=</BazelArgs>
|
||||
<BazelArgs Condition="'$(Configuration)|$(Platform)'=='Release|GGP'">$(BazelArgs) --linkopt=-Wl,--strip-all</BazelArgs>
|
||||
<!-- Prevent protobuf recompilation (protobuf is written to "host" by default for both x84 and ggp, causing recompiles). -->
|
||||
<BazelArgs Condition="'$(Platform)'=='x64'">$(BazelArgs) --distinct_host_configuration=false</BazelArgs>
|
||||
<!-- Windows uses /LTCG (link-time code generation), but no /GL (global optimization), which is a requirement for that. -->
|
||||
<BazelArgs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(BazelArgs) --copt=/GL</BazelArgs>
|
||||
<!-- Strip unused symbols on GGP. -->
|
||||
<BazelArgs Condition="'$(Configuration)|$(Platform)'=='Release|GGP'">$(BazelArgs) --copt=-fdata-sections --copt=-ffunction-sections --linkopt=-Wl,--gc-sections</BazelArgs>
|
||||
<!-- VS creates a bazel-out DIRECTORY if it doesn't exist yet and prevents Bazel from creating a bazel-out SYMLINK. -->
|
||||
<RmBazelOutDir>cmd.exe /Q /C $(SolutionDir)rm_bazel_out_dir.bat &&</RmBazelOutDir>
|
||||
<!-- Bazel output is always read-only, which confuses a bunch of tools that upload binaries to gamelets and fail the second time. -->
|
||||
<MakeRW>&& attrib -r $(OutDir)*</MakeRW>
|
||||
<!-- Include standard libraries for GGP Intellisense -->
|
||||
<BazelIncludePaths Condition="'$(Platform)'=='GGP'">$(GGP_SDK_PATH)BaseSDK\LLVM\10.0.1\include\c++\v1;$(GGP_SDK_PATH)BaseSDK\LLVM\10.0.1\lib\clang\10.0.1\include;$(GGP_SDK_PATH)sysroot\usr\include\x86_64-linux-gnu;$(GGP_SDK_PATH)sysroot\usr\include;$(BazelIncludePaths)</BazelIncludePaths>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Define NMake properties. -->
|
||||
<PropertyGroup>
|
||||
<NMakeIncludeSearchPath>$(SolutionDir)..\..\bazel-out\$(BazelPlatformDir)-$(BazelCompilationMode)\bin;$(BazelIncludePaths)</NMakeIncludeSearchPath>
|
||||
<NMakeBuildCommandLine>$(RmBazelOutDir) bazel build --compilation_mode=$(BazelCompilationMode) $(BazelArgs) $(BazelTargets) $(BazelSedCommand) $(MakeRW)</NMakeBuildCommandLine>
|
||||
<NMakeCleanCommandLine>$(RmBazelOutDir) bazel clean</NMakeCleanCommandLine>
|
||||
<NMakeReBuildCommandLine>$(RmBazelOutDir) bazel clean && bazel build --compilation_mode=$(BazelCompilationMode) $(BazelArgs) $(BazelTargets) $(BazelSedCommand) $(MakeRW)</NMakeReBuildCommandLine>
|
||||
<NMakeOutput>$(OutDir)$(BazelOutputFile)</NMakeOutput>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
Reference in New Issue
Block a user