Skip to content

Commit 4646f6b

Browse files
committed
validate cmd line args for prebuilt libs
1 parent 1c4bd31 commit 4646f6b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

scripts/build_desktop_app_with_firebase.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,19 @@ def is_sdk_path_source(sdk_dir):
6464
# should work for our purpose.
6565
return os.path.exists(os.path.join(sdk_dir, 'build_tools'))
6666

67+
def validate_prebuilt_args(arch, config):
68+
"""Validate cmd line args for build with prebuilt libraries"""
69+
# Some options are not available when using prebuilt libraries"""
70+
if platform.system() == 'Darwin':
71+
if arch == 'x86' or config == 'Debug':
72+
raise ValueError("Prebuilt mac firebase libraries are built for x64 and Release mode only. "
73+
"Please fix the command line arguments and try again")
74+
75+
if platform.system() == 'Linux':
76+
if config == 'Debug':
77+
raise ValueError("Prebuilt linux firebase libraries are built with Release mode only. "
78+
"Please fix the --config command line argument and try again.")
79+
6780
def get_vcpkg_triplet(arch, msvc_runtime_library='static'):
6881
""" Get vcpkg target triplet (platform definition).
6982
@@ -240,6 +253,7 @@ def main():
240253
build_app_with_source(args.app_dir, args.sdk_dir, args.build_dir, args.arch,
241254
args.msvc_runtime_library, args.config, args.target_format)
242255
else:
256+
validate_prebuilt_args(args.arch, args.config)
243257
print("SDK path provided is Firebase C++ prebuilt libraries. Building...")
244258
build_app_with_prebuilt(args.app_dir, args.sdk_dir, args.build_dir, args.arch,
245259
args.msvc_runtime_library, args.config)

0 commit comments

Comments
 (0)