8787 'mac_framework_private_headers' ,
8888]
8989
90+ generator_filelist_paths = None
91+
9092# Xcode's standard set of library directories, which don't need to be duplicated
9193# in LIBRARY_SEARCH_PATHS. This list is not exhaustive, but that's okay.
9294xcode_standard_library_dirs = frozenset ([
@@ -578,6 +580,26 @@ def PerformBuild(data, configurations, params):
578580 subprocess .check_call (arguments )
579581
580582
583+ def CalculateGeneratorInputInfo (params ):
584+ toplevel = params ['options' ].toplevel_dir
585+ if params .get ('flavor' ) == 'ninja' :
586+ generator_dir = os .path .relpath (params ['options' ].generator_output or '.' )
587+ output_dir = params .get ('generator_flags' , {}).get ('output_dir' , 'out' )
588+ output_dir = os .path .normpath (os .path .join (generator_dir , output_dir ))
589+ qualified_out_dir = os .path .normpath (os .path .join (
590+ toplevel , output_dir , 'gypfiles-xcode-ninja' ))
591+ else :
592+ output_dir = os .path .normpath (os .path .join (toplevel , 'xcodebuild' ))
593+ qualified_out_dir = os .path .normpath (os .path .join (
594+ toplevel , output_dir , 'gypfiles' ))
595+
596+ global generator_filelist_paths
597+ generator_filelist_paths = {
598+ 'toplevel' : toplevel ,
599+ 'qualified_out_dir' : qualified_out_dir ,
600+ }
601+
602+
581603def GenerateOutput (target_list , target_dicts , data , params ):
582604 # Optionally configure each spec to use ninja as the external builder.
583605 ninja_wrapper = params .get ('flavor' ) == 'ninja'
@@ -590,6 +612,15 @@ def GenerateOutput(target_list, target_dicts, data, params):
590612 parallel_builds = generator_flags .get ('xcode_parallel_builds' , True )
591613 serialize_all_tests = \
592614 generator_flags .get ('xcode_serialize_all_test_runs' , True )
615+ upgrade_check_project_version = \
616+ generator_flags .get ('xcode_upgrade_check_project_version' , None )
617+
618+ # Format upgrade_check_project_version with leading zeros as needed.
619+ if upgrade_check_project_version :
620+ upgrade_check_project_version = str (upgrade_check_project_version )
621+ while len (upgrade_check_project_version ) < 4 :
622+ upgrade_check_project_version = '0' + upgrade_check_project_version
623+
593624 skip_excluded_files = \
594625 not generator_flags .get ('xcode_list_excluded_files' , True )
595626 xcode_projects = {}
@@ -604,9 +635,17 @@ def GenerateOutput(target_list, target_dicts, data, params):
604635 xcode_projects [build_file ] = xcp
605636 pbxp = xcp .project
606637
638+ # Set project-level attributes from multiple options
639+ project_attributes = {};
607640 if parallel_builds :
608- pbxp .SetProperty ('attributes' ,
609- {'BuildIndependentTargetsInParallel' : 'YES' })
641+ project_attributes ['BuildIndependentTargetsInParallel' ] = 'YES'
642+ if upgrade_check_project_version :
643+ project_attributes ['LastUpgradeCheck' ] = upgrade_check_project_version
644+ project_attributes ['LastTestingUpgradeCheck' ] = \
645+ upgrade_check_project_version
646+ project_attributes ['LastSwiftUpdateCheck' ] = \
647+ upgrade_check_project_version
648+ pbxp .SetProperty ('attributes' , project_attributes )
610649
611650 # Add gyp/gypi files to project
612651 if not generator_flags .get ('standalone' ):
@@ -648,14 +687,17 @@ def GenerateOutput(target_list, target_dicts, data, params):
648687 'loadable_module' : 'com.googlecode.gyp.xcode.bundle' ,
649688 'shared_library' : 'com.apple.product-type.library.dynamic' ,
650689 'static_library' : 'com.apple.product-type.library.static' ,
690+ 'mac_kernel_extension' : 'com.apple.product-type.kernel-extension' ,
651691 'executable+bundle' : 'com.apple.product-type.application' ,
652692 'loadable_module+bundle' : 'com.apple.product-type.bundle' ,
653693 'loadable_module+xctest' : 'com.apple.product-type.bundle.unit-test' ,
654694 'shared_library+bundle' : 'com.apple.product-type.framework' ,
655695 'executable+extension+bundle' : 'com.apple.product-type.app-extension' ,
656696 'executable+watch+extension+bundle' :
657697 'com.apple.product-type.watchkit-extension' ,
658- 'executable+watch+bundle' : 'com.apple.product-type.application.watchapp' ,
698+ 'executable+watch+bundle' :
699+ 'com.apple.product-type.application.watchapp' ,
700+ 'mac_kernel_extension+bundle' : 'com.apple.product-type.kernel-extension' ,
659701 }
660702
661703 target_properties = {
0 commit comments