diff options
author | crupest <crupest@outlook.com> | 2019-03-30 21:15:25 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2019-03-30 21:15:25 +0800 |
commit | 9af5abeb3db9991ec5b8293883d1fc5913e89456 (patch) | |
tree | 40f8119cf6814bb6df76ff822ef5a2d4c9c4d5ca | |
parent | ee130224147f034e02d1d4d83e3f2d5a59e625c2 (diff) | |
download | cru-9af5abeb3db9991ec5b8293883d1fc5913e89456.tar.gz cru-9af5abeb3db9991ec5b8293883d1fc5913e89456.tar.bz2 cru-9af5abeb3db9991ec5b8293883d1fc5913e89456.zip |
...
-rw-r--r-- | README.md | 6 | ||||
-rw-r--r-- | tools/build.py | 23 |
2 files changed, 18 insertions, 11 deletions
@@ -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() |