Skip to content

Commit f349058

Browse files
cynthiajoanCynthia Jianga-maurice
authored
windows build python script (#287)
check in the windows build python script Co-authored-by: Cynthia Jiang <[email protected]> Co-authored-by: a-maurice <[email protected]>
1 parent d25407c commit f349058

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

.github/workflows/sdk_build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ jobs:
148148
if: startsWith(matrix.os, 'windows')
149149
shell: bash
150150
run: |
151+
# swig_dir_slash_fix=${SWIG_DIR//\\//}
152+
# python scripts/build_scripts/build_zips.py --platform=windows --unity_root="$UNITY_ROOT_DIR" --cmake_extras='-DSWIG_DIR=$swig_dir_slash_fix'
151153
# ./build_windows_x64.bat ${{ github.event.inputs.additional_cmake_flags }} TODO convert to python script
152154
mkdir ${{ matrix.build_dir }}
153155
pushd ${{ matrix.build_dir }}

scripts/build_scripts/build_zips.py

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ def get_windows_args():
364364
cmake args for windows platform.
365365
"""
366366
result_args = []
367-
result_args.append('-G \"Visual Studio 16 2019\"')
367+
result_args.append('-G Visual Studio 16 2019')
368368
result_args.append('-A x64') # TODO flexibily for x32
369369
result_args.append("-DFIREBASE_PYTHON_HOST_EXECUTABLE:FILEPATH=%s" % sys.executable)
370370
return result_args
@@ -537,15 +537,22 @@ def main(argv):
537537
os.chdir(build_path)
538538
cmake_setup_args = [
539539
"cmake",
540-
source_path,
541-
"-DFIREBASE_INCLUDE_UNITY=ON",
542-
"-DFIREBASE_UNITY_BUILD_TESTS=ON",
543-
"-DFIREBASE_CPP_BUILD_STUB_TESTS=ON",
540+
source_path
544541
]
545542

546543
if FLAGS.verbose:
547544
cmake_setup_args.append('-DCMAKE_VERBOSE_MAKEFILE=1')
548545

546+
if is_windows_build():
547+
# windows args need to happen right after target path
548+
cmake_setup_args.extend(get_windows_args())
549+
550+
cmake_setup_args.extend([
551+
"-DFIREBASE_INCLUDE_UNITY=ON",
552+
"-DFIREBASE_UNITY_BUILD_TESTS=ON",
553+
"-DFIREBASE_CPP_BUILD_STUB_TESTS=ON",
554+
])
555+
549556
unity_root_args = get_unity_engine_folder_args(FLAGS.unity_root)
550557
if unity_root_args:
551558
cmake_setup_args.append(unity_root_args)
@@ -566,8 +573,6 @@ def main(argv):
566573
cmake_setup_args.extend(get_ios_args(source_path))
567574
elif is_android_build():
568575
cmake_setup_args.extend(get_android_args())
569-
elif is_windows_build():
570-
cmake_setup_args.extend(get_windows_args())
571576
elif is_macos_build():
572577
cmake_setup_args.extend(get_macos_args())
573578

@@ -585,7 +590,11 @@ def main(argv):
585590
make_macos_multi_arch_build(cmake_setup_args)
586591
else:
587592
subprocess.call(cmake_setup_args)
588-
subprocess.call("make")
593+
if is_windows_build():
594+
# no make command in windows. TODO make config passable
595+
subprocess.call("cmake --build . --config Release")
596+
else:
597+
subprocess.call("make")
589598

590599
cmake_pack_args = [
591600
"cpack",

0 commit comments

Comments
 (0)