build: build ffmpeg and native_mksnapshot for GN release builds (#14240)
* build ffmpeg and native_mksnapshot for GN release builds * Test ffmpeg via verify-ffmpeg.py * remove sccache from Windows builds
This commit is contained in:
parent
a2a7c6b062
commit
5a72441b2a
7 changed files with 87 additions and 22 deletions
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
|
@ -17,14 +17,10 @@ PRODUCT_NAME = electron_gyp()['product_name%']
|
|||
|
||||
|
||||
def main():
|
||||
os.chdir(SOURCE_ROOT)
|
||||
args = parse_args()
|
||||
os.chdir(args.source_root)
|
||||
|
||||
if len(sys.argv) == 2 and sys.argv[1] == '-R':
|
||||
config = 'R'
|
||||
else:
|
||||
config = 'D'
|
||||
|
||||
app_path = create_app_copy(config)
|
||||
app_path = create_app_copy(args)
|
||||
|
||||
if sys.platform == 'darwin':
|
||||
electron = os.path.join(app_path, 'Contents', 'MacOS', PRODUCT_NAME)
|
||||
|
@ -42,11 +38,12 @@ def main():
|
|||
ffmpeg_name = 'libffmpeg.so'
|
||||
|
||||
# Copy ffmpeg without proprietary codecs into app
|
||||
shutil.copy(os.path.join(FFMPEG_LIBCC_PATH, ffmpeg_name), ffmpeg_app_path)
|
||||
shutil.copy(os.path.join(args.ffmpeg_path, ffmpeg_name), ffmpeg_app_path)
|
||||
|
||||
returncode = 0
|
||||
try:
|
||||
test_path = os.path.join('spec', 'fixtures', 'no-proprietary-codecs.js')
|
||||
test_path = os.path.join(SOURCE_ROOT, 'spec', 'fixtures',
|
||||
'no-proprietary-codecs.js')
|
||||
subprocess.check_call([electron, test_path] + sys.argv[1:])
|
||||
except subprocess.CalledProcessError as e:
|
||||
returncode = e.returncode
|
||||
|
@ -57,9 +54,10 @@ def main():
|
|||
|
||||
|
||||
# Create copy of app to install ffmpeg library without proprietary codecs into
|
||||
def create_app_copy(config):
|
||||
initial_app_path = os.path.join(SOURCE_ROOT, 'out', config)
|
||||
app_path = os.path.join(SOURCE_ROOT, 'out', config + '-no-proprietary-codecs')
|
||||
def create_app_copy(args):
|
||||
initial_app_path = os.path.join(args.source_root, 'out', args.config)
|
||||
app_path = os.path.join(args.source_root, 'out',
|
||||
args.config + '-no-proprietary-codecs')
|
||||
|
||||
if sys.platform == 'darwin':
|
||||
app_name = '{0}.app'.format(PRODUCT_NAME)
|
||||
|
@ -70,6 +68,19 @@ def create_app_copy(config):
|
|||
shutil.copytree(initial_app_path, app_path, symlinks=True)
|
||||
return app_path
|
||||
|
||||
def parse_args():
|
||||
parser = argparse.ArgumentParser(description='Test non-proprietary ffmpeg')
|
||||
parser.add_argument('-c', '--config',
|
||||
help='Test with Release or Debug configuration',
|
||||
default='D',
|
||||
required=False)
|
||||
parser.add_argument('--source-root',
|
||||
default=SOURCE_ROOT,
|
||||
required=False)
|
||||
parser.add_argument('--ffmpeg-path',
|
||||
default=FFMPEG_LIBCC_PATH,
|
||||
required=False)
|
||||
return parser.parse_args()
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue