Skip to content

Commit 9f30b2c

Browse files
committed
using right source dir for cmake
1 parent 17e3b44 commit 9f30b2c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

scripts/gha/build_ios_tvos.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -433,12 +433,13 @@ def build_xcframeworks(frameworks_path, xcframeworks_path, template_info_plist):
433433
dest_headers_path)
434434

435435

436-
def cmake_configure_and_build(build_path, toolchain,
436+
def cmake_configure_and_build(source_path, build_path, toolchain,
437437
archive_output_path, targets,
438438
architecture=None, toolchain_platform=None):
439439
"""CMake configure build project and build libraries.
440440
441441
Args:
442+
source_path (str): Source directory containing top level CMakeLists.txt.
442443
build_path (str): CMake build path (where project is built).
443444
toolchain (str): Path to CMake toolchain file. Differs based on os and/or
444445
platform.
@@ -450,7 +451,7 @@ def cmake_configure_and_build(build_path, toolchain,
450451
builds only. Accepts all platforms supported by the tvos toolchain.
451452
(eg: 'TVOS', 'SIMULATOR_TVOS' etc)
452453
"""
453-
cmd = ['cmake', '-S', '.', '-B', build_path]
454+
cmd = ['cmake', '-S', source_path, '-B', build_path]
454455
cmd.append('-DCMAKE_TOOLCHAIN_FILE={0}'.format(toolchain))
455456
cmd.append('-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY={0}'.format(archive_output_path))
456457
if architecture:
@@ -512,7 +513,8 @@ def main():
512513
# For tvos builds, we pass a special cmake option PLATFORM to toolchain.
513514
toolchain_platform = os_platform_config['toolchain_platform'] if \
514515
apple_os == 'tvos' else None
515-
cmake_configure_and_build(build_path, os_platform_config['toolchain'],
516+
cmake_configure_and_build(args.source_dir, build_path,
517+
os_platform_config['toolchain'],
516518
archive_output_path, supported_targets,
517519
architecture, toolchain_platform)
518520
# Arrange frameworks

0 commit comments

Comments
 (0)