@@ -488,36 +488,36 @@ def main():
488
488
raise ValueError ('No supported targets found for {0}' .format (apple_os ))
489
489
490
490
frameworks_os_path = os .path .join (frameworks_path , apple_os )
491
- # for platform in args.platform:
492
- # os_platform_config = os_config.get(platform)
493
- # if not os_platform_config:
494
- # raise ValueError('Could not find configuration for platform '
495
- # '{0} for os {1}'.format(platform, apple_os))
496
-
497
- # archs_from_config = set(os_platform_config['architectures'])
498
- # supported_archs = archs_from_config.intersection(args.architecture)
499
- # if not supported_archs:
500
- # raise ValueError('Could not find valid architectures for platform '
501
- # '{0} for os {1}'.format(platform, apple_os))
502
-
503
- # for architecture in supported_archs:
504
- # platform_architecture_token = '{0}-{1}'.format(platform, architecture)
505
- # archive_output_path = os.path.join(frameworks_os_path,
506
- # platform_architecture_token)
507
- # # Eg: <build_dir>/tvos_cmake_build/device-arm64
508
- # build_path = os.path.join(args.build_dir,
509
- # '{0}_cmake_build'.format(apple_os),
510
- # platform_architecture_token)
511
- # # For ios builds, we specify architecture to cmake configure.
512
- # architecture = architecture if apple_os == 'ios' else None
513
- # # For tvos builds, we pass a special cmake option PLATFORM to toolchain.
514
- # toolchain_platform = os_platform_config['toolchain_platform'] if \
515
- # apple_os == 'tvos' else None
516
- # cmake_configure_and_build(build_path, os_platform_config['toolchain'],
517
- # archive_output_path, supported_targets,
518
- # architecture, toolchain_platform)
519
- # # Arrange frameworks
520
- # arrange_frameworks(archive_output_path)
491
+ for platform in args .platform :
492
+ os_platform_config = os_config .get (platform )
493
+ if not os_platform_config :
494
+ raise ValueError ('Could not find configuration for platform '
495
+ '{0} for os {1}' .format (platform , apple_os ))
496
+
497
+ archs_from_config = set (os_platform_config ['architectures' ])
498
+ supported_archs = archs_from_config .intersection (args .architecture )
499
+ if not supported_archs :
500
+ raise ValueError ('Could not find valid architectures for platform '
501
+ '{0} for os {1}' .format (platform , apple_os ))
502
+
503
+ for architecture in supported_archs :
504
+ platform_architecture_token = '{0}-{1}' .format (platform , architecture )
505
+ archive_output_path = os .path .join (frameworks_os_path ,
506
+ platform_architecture_token )
507
+ # Eg: <build_dir>/tvos_cmake_build/device-arm64
508
+ build_path = os .path .join (args .build_dir ,
509
+ '{0}_cmake_build' .format (apple_os ),
510
+ platform_architecture_token )
511
+ # For ios builds, we specify architecture to cmake configure.
512
+ architecture = architecture if apple_os == 'ios' else None
513
+ # For tvos builds, we pass a special cmake option PLATFORM to toolchain.
514
+ toolchain_platform = os_platform_config ['toolchain_platform' ] if \
515
+ apple_os == 'tvos' else None
516
+ cmake_configure_and_build (build_path , os_platform_config ['toolchain' ],
517
+ archive_output_path , supported_targets ,
518
+ architecture , toolchain_platform )
519
+ # Arrange frameworks
520
+ arrange_frameworks (archive_output_path )
521
521
522
522
# if we built for all architectures build universal framework as well.
523
523
build_universal_framework (frameworks_path )
0 commit comments