@@ -150,7 +150,7 @@ def install_cpp_dependencies_with_vcpkg(arch, msvc_runtime_library, cleanup=True
150150
151151def cmake_configure (build_dir , arch , msvc_runtime_library = 'static' , linux_abi = 'legacy' ,
152152 build_tests = True , config = None , target_format = None ,
153- use_openssl = False , disable_vcpkg = False , verbose = False ):
153+ use_openssl = False , disable_vcpkg = False , gha_build = False , verbose = False ):
154154 """ CMake configure.
155155
156156 If you are seeing problems when running this multiple times,
@@ -168,6 +168,8 @@ def cmake_configure(build_dir, arch, msvc_runtime_library='static', linux_abi='l
168168 use_openssl (bool) : Use prebuilt OpenSSL library instead of using boringssl
169169 downloaded and built during the cmake configure step.
170170 disable_vcpkg (bool): If True, skip vcpkg and just use CMake for deps.
171+ gha_build (bool): If True, this build will be marked as having been built
172+ from GitHub, which is useful for metrics tracking.
171173 verbose (bool): If True, enable verbose mode in the CMake file.
172174 """
173175 cmd = ['cmake' , '-S' , '.' , '-B' , build_dir ]
@@ -216,6 +218,10 @@ def cmake_configure(build_dir, arch, msvc_runtime_library='static', linux_abi='l
216218 if not use_openssl :
217219 cmd .append ('-DFIREBASE_USE_BORINGSSL=ON' )
218220
221+ # When building from GitHub Actions, this should always be set.
222+ if gha_build :
223+ cmd .append ('-DFIREBASE_GITHUB_ACTION_BUILD=ON' )
224+
219225 # Print out every command while building.
220226 if verbose :
221227 cmd .append ('-DCMAKE_VERBOSE_MAKEFILE=1' )
@@ -248,7 +254,7 @@ def main():
248254 # CMake configure
249255 cmake_configure (args .build_dir , args .arch , args .msvc_runtime_library , args .linux_abi ,
250256 args .build_tests , args .config , args .target_format ,
251- args .use_openssl , args .disable_vcpkg , args .verbose )
257+ args .use_openssl , args .disable_vcpkg , args .gha_build , args . verbose )
252258
253259 # CMake build
254260 # cmake --build build -j 8
@@ -278,6 +284,7 @@ def parse_cmdline_args():
278284 parser .add_argument ('--target' , nargs = '+' , help = 'A list of CMake build targets (eg: firebase_app firebase_auth)' )
279285 parser .add_argument ('--target_format' , default = None , help = '(Mac only) whether to output frameworks (default) or libraries.' )
280286 parser .add_argument ('--use_openssl' , action = 'store_true' , default = None , help = 'Use openssl for build instead of boringssl' )
287+ parser .add_argument ('--gha_build' , action = 'store_true' , default = None , help = 'Set to true when building on GitHub, for metric tracking purposes' )
281288 args = parser .parse_args ()
282289 return args
283290
0 commit comments