87
87
'mac_framework_private_headers' ,
88
88
]
89
89
90
+ generator_filelist_paths = None
91
+
90
92
# Xcode's standard set of library directories, which don't need to be duplicated
91
93
# in LIBRARY_SEARCH_PATHS. This list is not exhaustive, but that's okay.
92
94
xcode_standard_library_dirs = frozenset ([
@@ -578,6 +580,26 @@ def PerformBuild(data, configurations, params):
578
580
subprocess .check_call (arguments )
579
581
580
582
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
+
581
603
def GenerateOutput (target_list , target_dicts , data , params ):
582
604
# Optionally configure each spec to use ninja as the external builder.
583
605
ninja_wrapper = params .get ('flavor' ) == 'ninja'
@@ -590,6 +612,15 @@ def GenerateOutput(target_list, target_dicts, data, params):
590
612
parallel_builds = generator_flags .get ('xcode_parallel_builds' , True )
591
613
serialize_all_tests = \
592
614
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
+
593
624
skip_excluded_files = \
594
625
not generator_flags .get ('xcode_list_excluded_files' , True )
595
626
xcode_projects = {}
@@ -604,9 +635,17 @@ def GenerateOutput(target_list, target_dicts, data, params):
604
635
xcode_projects [build_file ] = xcp
605
636
pbxp = xcp .project
606
637
638
+ # Set project-level attributes from multiple options
639
+ project_attributes = {};
607
640
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 )
610
649
611
650
# Add gyp/gypi files to project
612
651
if not generator_flags .get ('standalone' ):
@@ -648,14 +687,17 @@ def GenerateOutput(target_list, target_dicts, data, params):
648
687
'loadable_module' : 'com.googlecode.gyp.xcode.bundle' ,
649
688
'shared_library' : 'com.apple.product-type.library.dynamic' ,
650
689
'static_library' : 'com.apple.product-type.library.static' ,
690
+ 'mac_kernel_extension' : 'com.apple.product-type.kernel-extension' ,
651
691
'executable+bundle' : 'com.apple.product-type.application' ,
652
692
'loadable_module+bundle' : 'com.apple.product-type.bundle' ,
653
693
'loadable_module+xctest' : 'com.apple.product-type.bundle.unit-test' ,
654
694
'shared_library+bundle' : 'com.apple.product-type.framework' ,
655
695
'executable+extension+bundle' : 'com.apple.product-type.app-extension' ,
656
696
'executable+watch+extension+bundle' :
657
697
'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' ,
659
701
}
660
702
661
703
target_properties = {
0 commit comments