aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/build_command_buffer.py
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2016-02-18 06:40:55 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-02-18 06:40:55 -0800
commitc969bfced3849a73f6c015367beed5b46142f333 (patch)
tree9da434d4802367e92ed652da6d08931783560017 /tools/build_command_buffer.py
parent5bd98a244bb1ab1b3cad945e2fa1ce3dfd62d8cf (diff)
Make build_command_buffer.py work on Mac and Windows.
Also specify GYP_GENERATORS and add flags to gclient sync to make it more likely to succeed. BUG=skia:4957 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1704193002 Review URL: https://codereview.chromium.org/1704193002
Diffstat (limited to 'tools/build_command_buffer.py')
-rwxr-xr-xtools/build_command_buffer.py35
1 files changed, 30 insertions, 5 deletions
diff --git a/tools/build_command_buffer.py b/tools/build_command_buffer.py
index 9edc4229a3..4c8460b719 100755
--- a/tools/build_command_buffer.py
+++ b/tools/build_command_buffer.py
@@ -86,7 +86,6 @@ def main():
'to create).')
chrome_target_dir_rel = os.path.join('out', args.chrome_build_type)
- chrome_target_dir = os.path.join(chrome_src_dir, chrome_target_dir_rel)
if not args.no_sync:
try:
@@ -104,7 +103,9 @@ def main():
if not args.no_sync:
try:
- subprocess.check_call(['gclient', 'sync'], cwd=chrome_src_dir)
+ os.environ['GYP_GENERATORS'] = 'ninja'
+ subprocess.check_call(['gclient', 'sync', '--reset', '--force'],
+ cwd=chrome_src_dir)
except subprocess.CalledProcessError as error:
sys.exit('Error (ret code: %s) calling "%s" in %s' % error.returncode,
error.cmd, chrome_src_dir)
@@ -117,9 +118,33 @@ def main():
sys.exit('Error (ret code: %s) calling "%s" in %s' % error.returncode,
error.cmd, chrome_src_dir)
- shared_lib_src = os.path.join(chrome_target_dir, 'lib',
- 'libcommand_buffer_gles2.so')
- shared_lib_dst = os.path.join(args.output_dir, 'libcommand_buffer_gles2.so')
+ # The command buffer shared library will have a different extension on Linux,
+ # Mac, and Windows. Also, on Linux it will be in a 'lib' subdirectory and
+ # needs to be placed in a 'lib' subdirectory of the directory containing the
+ # Skia executable.
+ platform = sys.platform
+ if platform == 'cygwin':
+ platform = 'win32'
+
+ shared_lib_ext = '.so'
+ shared_lib_subdir = 'lib'
+ if platform == 'darwin':
+ shared_lib_ext = '.dylib'
+ shared_lib_subdir = ''
+ elif platform == 'win32':
+ shared_lib_ext = '.dll'
+ shared_lib_subdir = ''
+
+ shared_lib_src_dir = os.path.join(chrome_src_dir, chrome_target_dir_rel,
+ shared_lib_subdir)
+ shared_lib_dst_dir = os.path.join(args.output_dir, shared_lib_subdir)
+ # Make the subdir for the dst if does not exist
+ if shared_lib_subdir and not os.path.isdir(shared_lib_dst_dir):
+ os.mkdir(shared_lib_dst_dir)
+
+ shared_lib_name = 'libcommand_buffer_gles2' + shared_lib_ext
+ shared_lib_src = os.path.join(shared_lib_src_dir, shared_lib_name)
+ shared_lib_dst = os.path.join(shared_lib_dst_dir, shared_lib_name)
if not os.path.isfile(shared_lib_src):
sys.exit('Command buffer shared library not at expected location: ' +