From 1cc7c0245770c120927f736c40fbe8988bb3c280 Mon Sep 17 00:00:00 2001 From: Yun Peng Date: Mon, 29 May 2017 17:11:28 +0200 Subject: Update Windows document 1. We are not high experimental any more 2. Point known issues to the right place 3. Make it clear that we also support python 3 4. MSVC is the default on Windows toolchain since 0.5.0 Change-Id: I804215b7b14263e43b30cdf76a9aaf0eb4598cee PiperOrigin-RevId: 157398506 --- site/versions/master/docs/install.md | 2 +- site/versions/master/docs/windows.md | 25 ++++++++++++++++--------- 2 files changed, 17 insertions(+), 10 deletions(-) (limited to 'site') diff --git a/site/versions/master/docs/install.md b/site/versions/master/docs/install.md index 1109bb1de1..fe7c46e650 100644 --- a/site/versions/master/docs/install.md +++ b/site/versions/master/docs/install.md @@ -9,7 +9,7 @@ See the instructions for installing Bazel on: * [Ubuntu Linux (16.04, 15.10, and 14.04)](install-ubuntu.md) * [Mac OS X](install-os-x.md) -* [Windows (highly experimental)](install-windows.md) +* [Windows (experimental)](install-windows.md) For other platforms, you can try to [compile from source](install-compile-source.md). diff --git a/site/versions/master/docs/windows.md b/site/versions/master/docs/windows.md index 225325e135..02e10d0f16 100644 --- a/site/versions/master/docs/windows.md +++ b/site/versions/master/docs/windows.md @@ -56,7 +56,7 @@ To **run** Bazel (even pre-built binaries), you will need: but then you will need to compile Bazel from the distribution archive (the source zip file) so that it's linked against the right version of ``msys-2.0.dll``. See also the - [known issues](install.md#compiling-from-source-issues). + [known issues](install-compile-source.md#known-issues-when-compiling-from-source). * Several msys2 packages. Use the ``pacman`` command to install them: ``` @@ -69,7 +69,7 @@ To **compile** Bazel, in addition to the above you will need: or the full [Visual C++](https://www.visualstudio.com/) (as part of Visual Studio; Community Edition is fine) with Windows SDK installed. * You may need to apply some patches/workarounds, see the - [known issues](install.md#compiling-from-source-issues). + [known issues](install-compile-source.md#known-issues-when-compiling-from-source). ## Compiling Bazel on Windows @@ -101,9 +101,10 @@ You can set `BAZEL_VS` environment variable to tell Bazel where Visual Studio is, otherwise Bazel will try to find the latest version installed.
For example: `export BAZEL_VS="C:/Program Files (x86)/Microsoft Visual Studio 14.0"` -* [Python 2.7](https://www.python.org/downloads/) -
Currently, we use python wrapper scripts to call the actual MSVC compiler, so -please make sure Python is installed and its location is added into PATH. +* [Python](https://www.python.org/downloads/) +
Both Python 2 and Python 3 are supported. +Currently, we use python wrapper scripts to call the actual MSVC compiler, so +please make sure python is installed and its location is added into PATH. It's also a good idea to set `BAZEL_PYTHON` environment variable to tell Bazel where python is.
For example: `export BAZEL_PYTHON=C:/Python27/python.exe` @@ -112,14 +113,20 @@ Bazel will auto-configure the location of Visual Studio and Python at the first time you build any target. If you need to auto-configure again, just run `bazel clean` then build a target. -If everything is set up, you can build C++ target now! However, since MSVC -toolchain is not default on Windows yet, you should use flag +If everything is set up, you can build C++ target now! + +```bash +bazel build examples/cpp:hello-world +./bazel-bin/examples/cpp/hello-world.exe +bazel run examples/cpp:hello-world +``` + +However, with Bazel version prior to 0.5.0, MSVC +toolchain is not default on Windows, you should use flag `--cpu=x64_windows_msvc` to enable it like this: ```bash bazel build --cpu=x64_windows_msvc examples/cpp:hello-world -./bazel-bin/examples/cpp/hello-world.exe -bazel run --cpu=x64_windows_msvc examples/cpp:hello-world ``` ### Build Java -- cgit v1.2.3