1 REM Copyright 2022 The Chromium Authors.
\r
2 REM Use of this source code is governed by a BSD-style license that can be
\r
3 REM found in the LICENSE file.
\r
7 REM This script is meant to be run once to setup the example demo agent.
\r
8 REM Run it with one command line argument: the path to a directory where the
\r
9 REM demo agent will be built. This should be a directory outside the SDK
\r
10 REM directory tree. By default, if no directory is supplied, a directory
\r
11 REM named `build` in the project root will be used.
\r
13 REM Once the build is prepared, the demo binary is built using the command
\r
14 REM `cmake --build <build-dir>`, where <build-dir> is the same argument given
\r
18 call :ABSPATH "%ROOT_DIR%\demo" DEMO_DIR
\r
19 call :ABSPATH "%ROOT_DIR%\proto" PROTO_DIR
\r
21 REM BUILD_DIR defaults to $ROOT_DIR/build if no argument is provided.
\r
23 call :ABSPATH "%ROOT_DIR%\build" BUILD_DIR
\r
29 echo Root dir: %ROOT_DIR%
\r
30 echo Build dir: %BUILD_DIR%
\r
31 echo Demo dir: %DEMO_DIR%
\r
32 echo Proto dir: %PROTO_DIR%
\r
35 REM Prepare build directory
\r
37 REM Prepare protobuf out directory
\r
38 mkdir "%BUILD_DIR%\gen"
\r
39 REM Enter build directory
\r
42 REM Install vcpkg and use it to install Google Protocol Buffers.
\r
43 IF NOT exist .\vcpkg\ (
\r
44 cmd/c git clone https://github.com/microsoft/vcpkg
\r
45 cmd/c .\vcpkg\bootstrap-vcpkg.bat -disableMetrics
\r
47 echo vcpkg is already installed.
\r
49 REM Install any packages we want from vcpkg.
\r
50 cmd/c .\vcpkg\vcpkg install protobuf:x64-windows
\r
51 cmd/c .\vcpkg\vcpkg install gtest:x64-windows
\r
53 REM Generate the build files.
\r
54 set CMAKE_TOOLCHAIN_FILE=./vcpkg/scripts/buildsystems/vcpkg.cmake
\r
59 echo To build, type: cmake --build "%BUILD_DIR%"
\r
64 REM Resolve relative path in %1 and set it into variable %2.
\r