@@ -1756,19 +1756,12 @@ def generate_single_build_target(self, objects_dict, target_name, target) -> Non
1756
1756
settings_dict .add_item ('GCC_PREFIX_HEADER' , f'$(PROJECT_DIR)/{ relative_pch_path } ' )
1757
1757
settings_dict .add_item ('GCC_PREPROCESSOR_DEFINITIONS' , '' )
1758
1758
settings_dict .add_item ('GCC_SYMBOLS_PRIVATE_EXTERN' , 'NO' )
1759
- header_arr = PbxArray ()
1760
- unquoted_headers = []
1761
- unquoted_headers .append (self .get_target_private_dir_abs (target ))
1759
+ unquoted_headers = [self .get_target_private_dir_abs (target )]
1762
1760
if target .implicit_include_directories :
1763
1761
unquoted_headers .append (os .path .join (self .environment .get_build_dir (), target .get_subdir ()))
1764
1762
unquoted_headers .append (os .path .join (self .environment .get_source_dir (), target .get_subdir ()))
1765
- if headerdirs :
1766
- for i in headerdirs :
1767
- i = os .path .normpath (i )
1768
- unquoted_headers .append (i )
1769
- for i in unquoted_headers :
1770
- header_arr .add_item (f'"{ i } "' )
1771
- settings_dict .add_item ('HEADER_SEARCH_PATHS' , header_arr )
1763
+ unquoted_headers += headerdirs
1764
+ settings_dict .add_item ('HEADER_SEARCH_PATHS' , self .normalize_header_search_paths (unquoted_headers ))
1772
1765
settings_dict .add_item ('INSTALL_PATH' , install_path )
1773
1766
settings_dict .add_item ('LIBRARY_SEARCH_PATHS' , '' )
1774
1767
if isinstance (target , build .SharedModule ):
@@ -1796,6 +1789,15 @@ def generate_single_build_target(self, objects_dict, target_name, target) -> Non
1796
1789
warn_array .add_item ('"$(inherited)"' )
1797
1790
bt_dict .add_item ('name' , buildtype )
1798
1791
1792
+ def normalize_header_search_paths (self , header_dirs ) -> PbxArray :
1793
+ header_arr = PbxArray ()
1794
+ for i in header_dirs :
1795
+ np = os .path .normpath (i )
1796
+ # Make sure Xcode will not split single path into separate entries, escaping space with a slash is not enought
1797
+ item = f'"\\ \" { np } \\ \" "' if ' ' in np else f'"{ np } "'
1798
+ header_arr .add_item (item )
1799
+ return header_arr
1800
+
1799
1801
def add_otherargs (self , settings_dict , langargs ):
1800
1802
for langname , args in langargs .items ():
1801
1803
if args :
0 commit comments