aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md6
-rw-r--r--tools/build.py23
2 files changed, 18 insertions, 11 deletions
diff --git a/README.md b/README.md
index b722e815..09b7174f 100644
--- a/README.md
+++ b/README.md
@@ -10,7 +10,11 @@ It is **under construction**.
## build
-Set python2 on path to make skia build tool work. Use python3 to run `tool/build.py`. Run with `-h` to see the options.
+Set python**2** on path to allow skia build tool work. Use python**3** to run `tool/build.py`. Run with `-h` to see the options.
+
+Notice: x86 is **not** currently supported!
+
+Tips: You can run the build script with `--only-skia` to build the skia dependency fisrt. Then feel free to open an ide and edit the source code of cruui and build it with command in ide.
## structure of repository
diff --git a/tools/build.py b/tools/build.py
index 0fc23f18..186099e9 100644
--- a/tools/build.py
+++ b/tools/build.py
@@ -6,9 +6,11 @@ import sys
parser = argparse.ArgumentParser()
parser.add_argument('-a', '--arch', choices=['x86', 'x64'],
- required=True, help='specify target cpu architecture')
+ default='x64', help='specify target cpu architecture')
parser.add_argument('-c', '--config', choices=['Debug', 'Release'],
required=True, help='specify build configuration')
+parser.add_argument('--only-skia', action='store_true',
+ help='when this option is specified, only skia is built')
parser.add_argument('--clang-build-skia', action='store_true',
help='whether use clang to build skia')
args = parser.parse_args()
@@ -23,7 +25,6 @@ if args.arch == 'x86' and args.clang_build_skia:
raise ConflictArgumentError('clang does not support to build skia in x86')
project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
-os.chdir(project_root)
def detect_ninja():
@@ -35,10 +36,11 @@ def detect_ninja():
stdout=sys.stdout, stderr=sys.stderr)
-detect_ninja()
+def build_skia():
+ os.chdir(project_root)
+ detect_ninja()
-def build_skia():
subprocess.check_call('py -2 .\\skia\\tools\\git-sync-deps',
stdout=sys.stdout, stderr=sys.stderr)
@@ -81,12 +83,9 @@ def build_skia():
subprocess.check_call('ninja -C .\\out\\{} skia'.format(out_dir))
-build_skia()
-
-os.chdir(project_root)
-
-
def build_cru_ui():
+ os.chdir(project_root)
+
os.environ['PreferredToolArchitecture'] = 'x64' # use vs x64 toolchain
generater_vs_arch_map = {
@@ -103,4 +102,8 @@ def build_cru_ui():
stdout=sys.stdout, stderr=sys.stderr)
-build_cru_ui()
+if args.only_skia:
+ build_skia()
+else:
+ build_skia()
+ build_cru_ui()