From 2052c86a30dffcf124fd7beac293e7fce87bf5cb Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Wed, 14 Dec 2016 11:06:04 -0500 Subject: [PATCH] Move, rename, and document Visual Studio GN helper script BUG=skia: DOCS_PREVIEW= https://skia.org/?cl=5983 Change-Id: I32ac2c5275eb86adaa2be9ceee061b2956db70ad Reviewed-on: https://skia-review.googlesource.com/5983 Commit-Queue: Brian Osman Reviewed-by: Hal Canary --- fix-gn-sln.py => gn/gn_meta_sln.py | 0 site/user/build.md | 25 +++++++++++++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) rename fix-gn-sln.py => gn/gn_meta_sln.py (100%) diff --git a/fix-gn-sln.py b/gn/gn_meta_sln.py similarity index 100% rename from fix-gn-sln.py rename to gn/gn_meta_sln.py diff --git a/site/user/build.md b/site/user/build.md index e5ef3d4..37a17b6 100644 --- a/site/user/build.md +++ b/site/user/build.md @@ -84,10 +84,8 @@ Windows ------- Skia can build on Windows with Visual Studio 2015 Update 3. No older or newer -version is supported. If you use Visual Studio, you may want to pass -`--ide=vs` to `gn gen` to generate `all.sln`. - -The bots use a packaged toolchain, which you may be able to download like this: +version is supported. The bots use a packaged toolchain, which you may be able +to download like this: python infra/bots/assets/win_toolchain/download.py -t C:/toolchain @@ -95,6 +93,25 @@ If you pass that downloaded path to GN via `windk`, you can build using that toolchain instead of your own from Visual Studio. This toolchain is the only way we support 32-bit builds, by also setting `target_cpu="x86"`. +### Visual Studio Solutions + +If you use Visual Studio, you may want to pass `--ide=vs` to `gn gen` to +generate `all.sln`. That solution will exist within the GN directory for the +specific configuration, and will only build/run that configuration. + +If you want a Visual Studio Solution that supports multiple GN configurations, +there is a helper script. It requires that all of your GN directories be inside +the `out` directory. First, create all of your GN configurations as usual. +Pass `--ide=vs` when running `gn gen` for each one. Then: + + python gn/gn_meta_sln.py + +This creates a new dedicated output directory and solution file +`out/sln/skia.sln`. It has one solution configuration for each GN configuration, +and supports building and running any of them. It also adjusts syntax highlighting +of inactive code blocks based on preprocessor definitions from the selected +solution configuration. + CMake ----- -- 2.7.4