add hwcodec in build.py
usage: ./build.py --hwcodec Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
parent
847c4acb07
commit
7885f5ccb0
21
build.py
21
build.py
@ -66,6 +66,11 @@ def make_parser():
|
|||||||
default='',
|
default='',
|
||||||
help='Integrate features, windows only.'
|
help='Integrate features, windows only.'
|
||||||
'Available: IddDriver, PrivacyMode. Special value is "ALL" and empty "". Default is empty.')
|
'Available: IddDriver, PrivacyMode. Special value is "ALL" and empty "". Default is empty.')
|
||||||
|
parser.add_argument(
|
||||||
|
'--hwcodec',
|
||||||
|
action='store_true',
|
||||||
|
help='Enable feature hwcodec, windows only.'
|
||||||
|
)
|
||||||
return parser
|
return parser
|
||||||
|
|
||||||
|
|
||||||
@ -89,11 +94,9 @@ def download_extract_features(features, res_dir):
|
|||||||
print(f'{feat} extract end')
|
print(f'{feat} extract end')
|
||||||
|
|
||||||
|
|
||||||
def build_windows(feature):
|
def build_windows(args):
|
||||||
features = get_features(feature)
|
features = get_features(args.feature)
|
||||||
if not features:
|
if features:
|
||||||
os.system('cargo build --release --features inline')
|
|
||||||
else:
|
|
||||||
print(f'Build with features {list(features.keys())}')
|
print(f'Build with features {list(features.keys())}')
|
||||||
res_dir = 'resources'
|
res_dir = 'resources'
|
||||||
if os.path.isdir(res_dir) and not os.path.islink(res_dir):
|
if os.path.isdir(res_dir) and not os.path.islink(res_dir):
|
||||||
@ -102,8 +105,12 @@ def build_windows(feature):
|
|||||||
raise Exception(f'Find file {res_dir}, not a directory')
|
raise Exception(f'Find file {res_dir}, not a directory')
|
||||||
os.makedirs(res_dir, exist_ok=True)
|
os.makedirs(res_dir, exist_ok=True)
|
||||||
download_extract_features(features, res_dir)
|
download_extract_features(features, res_dir)
|
||||||
os.system('cargo build --release --features inline,with_rc')
|
|
||||||
|
|
||||||
|
with_rc = ',with_rc' if features else ''
|
||||||
|
hwcodec = ',hwcodec' if args.hwcodec else ''
|
||||||
|
cmd = 'cargo build --release --features inline' + with_rc + hwcodec
|
||||||
|
print(cmd)
|
||||||
|
os.system(cmd)
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
parser = make_parser()
|
parser = make_parser()
|
||||||
@ -123,7 +130,7 @@ def main():
|
|||||||
os.system('git checkout src/ui/common.tis')
|
os.system('git checkout src/ui/common.tis')
|
||||||
version = get_version()
|
version = get_version()
|
||||||
if windows:
|
if windows:
|
||||||
build_windows(args.feature)
|
build_windows(args)
|
||||||
# os.system('upx.exe target/release/rustdesk.exe')
|
# os.system('upx.exe target/release/rustdesk.exe')
|
||||||
os.system('mv target/release/rustdesk.exe target/release/RustDesk.exe')
|
os.system('mv target/release/rustdesk.exe target/release/RustDesk.exe')
|
||||||
pa = os.environ.get('P')
|
pa = os.environ.get('P')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user