Files
netris-cdc-file-transfer/NMakeBazelProject.targets
Lutz Justen 269fb2be45 [cdc_stream] Add a CLI client to start/stop asset streaming sessions (#4)
Implements the cdc_stream client and adjusts asset streaming in
various places to work better outside of a GGP environment.

This CL tries to get quoting for SSH commands right. It also brings
back the ability to start a streaming session from
asset_stream_manager.

Also cleans up Bazel targets setup. Since the sln file is now in root,
it is no longer necessary to prepend ../ to relative filenames to
make clicking on errors work.
2022-11-18 10:59:42 +01:00

52 lines
3.9 KiB
XML

<?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
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" />
</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>
<BazelArgs>--config=$(BazelPlatform)</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 &amp;&amp;</RmBazelOutDir>
<!-- Bazel output is always read-only, which confuses a bunch of tools that upload binaries to gamelets and fail the second time. -->
<MakeRW>&amp;&amp; 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) $(MakeRW)</NMakeBuildCommandLine>
<NMakeCleanCommandLine>$(RmBazelOutDir) bazel clean</NMakeCleanCommandLine>
<NMakeReBuildCommandLine>$(RmBazelOutDir) bazel clean &amp;&amp; bazel build --compilation_mode=$(BazelCompilationMode) $(BazelArgs) $(BazelTargets) $(MakeRW)</NMakeReBuildCommandLine>
<NMakeOutput>$(OutDir)$(BazelOutputFile)</NMakeOutput>
</PropertyGroup>
</Project>