@@ -69,7 +69,7 @@ def is_sdk_path_source(sdk_dir):
69
69
70
70
def validate_prebuilt_args (arch , config ):
71
71
"""Validate cmd line args for build with prebuilt libraries"""
72
- # Some options are not available when using prebuilt libraries"""
72
+ # Some options are not available when using prebuilt libraries.
73
73
if platform .system () == 'Darwin' :
74
74
if arch == 'x86' or config == 'Debug' :
75
75
raise ValueError ("Prebuilt mac Firebase libraries are built for x64 and Release mode only. "
@@ -122,7 +122,7 @@ def build_source_vcpkg_dependencies(sdk_source_dir, arch, msvc_runtime_library):
122
122
"""
123
123
# TODO: Remove this once dev branch of firebase-cpp-sdk repo has been merged
124
124
# onto main branch. This is required because vcpkg lives only in dev branch currently.
125
- # b/174141707
125
+ # b/174141707.
126
126
subprocess .run (['git' , 'checkout' , 'dev' ],
127
127
cwd = sdk_source_dir , check = True )
128
128
subprocess .run (['git' , 'pull' ], cwd = sdk_source_dir , check = True )
@@ -152,19 +152,19 @@ def build_app_with_source(app_dir, sdk_source_dir, build_dir, arch,
152
152
If its not specified, cmake's default is used (most likely Debug).
153
153
target_format (str): If specified, build for this targetformat ('frameworks' or 'libraries').
154
154
"""
155
- # Cmake configure
155
+ # Cmake configure.
156
156
cmd = ['cmake' , '-S' , '.' , '-B' , build_dir ]
157
157
cmd .append ('-DFIREBASE_CPP_SDK_DIR={0}' .format (sdk_source_dir ))
158
158
159
159
# If generator is not specifed, default for platform is used by cmake, else
160
- # use the specified value
160
+ # use the specified value.
161
161
if config :
162
162
cmd .append ('-DCMAKE_BUILD_TYPE={0}' .format (config ))
163
- # workaround, absl doesn't build without tests enabled
163
+ # workaround, absl doesn't build without tests enabled.
164
164
cmd .append ('-DBUILD_TESTING=off' )
165
165
166
166
if platform .system () == 'Linux' and arch == 'x86' :
167
- # Use a separate cmake toolchain for cross compiling linux x86 builds
167
+ # Use a separate cmake toolchain for cross compiling linux x86 builds.
168
168
vcpkg_toolchain_file_path = os .path .join (sdk_source_dir , 'external' , 'vcpkg' ,
169
169
'scripts' , 'buildsystems' , 'linux_32.cmake' )
170
170
else :
@@ -178,9 +178,9 @@ def build_app_with_source(app_dir, sdk_source_dir, build_dir, arch,
178
178
cmd .append ('-DVCPKG_TARGET_TRIPLET={0}' .format (vcpkg_triplet ))
179
179
180
180
if platform .system () == 'Windows' :
181
- # If building for x86, we should supply -A Win32 to cmake configure
182
- # Its a good habit to specify for x64 too as the default might be different
183
- # on different windows machines .
181
+ # If building for x86, we should supply -A Win32 to cmake configure.
182
+ # Since the default architecture for cmake varies from machine to machine,
183
+ # it is a good practice to specify it all the time (even for x64) .
184
184
cmd .append ('-A' )
185
185
cmd .append ('Win32' ) if arch == 'x86' else cmd .append ('x64' )
186
186
@@ -194,7 +194,7 @@ def build_app_with_source(app_dir, sdk_source_dir, build_dir, arch,
194
194
print ("Running {0}" .format (' ' .join (cmd )))
195
195
subprocess .run (cmd , cwd = app_dir , check = True )
196
196
197
- #CMake build
197
+ #CMake build.
198
198
cmd = ['cmake' , '--build' , build_dir , '-j' , str (os .cpu_count ()), '--config' , config ]
199
199
print ("Running {0}" .format (' ' .join (cmd )))
200
200
subprocess .run (cmd , cwd = app_dir , check = True )
@@ -203,7 +203,7 @@ def build_app_with_prebuilt(app_dir, sdk_prebuilt_dir, build_dir, arch,
203
203
msvc_runtime_library = 'static' , config = None ):
204
204
"""Build desktop app directly against the prebuilt Firebase C++ libraries.
205
205
206
- Since this invovles a cmake configure, it is advised to run this on a clean
206
+ Since this involves a cmake configure, it is advised to run this on a clean
207
207
build directory.
208
208
209
209
Args:
@@ -233,7 +233,7 @@ def build_app_with_prebuilt(app_dir, sdk_prebuilt_dir, build_dir, arch,
233
233
print ("Running {0}" .format (' ' .join (cmd )))
234
234
subprocess .run (cmd , cwd = app_dir , check = True )
235
235
236
- #CMake build
236
+ #CMake build.
237
237
cmd = ['cmake' , '--build' , build_dir , '-j' , str (os .cpu_count ()), '--config' , config ]
238
238
print ("Running {0}" .format (' ' .join (cmd )))
239
239
subprocess .run (cmd , cwd = app_dir , check = True )
0 commit comments