@@ -39,12 +39,10 @@ def main():
3939 'skia_use_system_freetype2=false' ,
4040 # 'skia_enable_gpu=true',
4141 'skia_use_metal=true' ,
42- 'extra_cflags_cc=["-frtti"]'
42+ 'extra_cflags_cc=["-frtti", "-stdlib=libc++" ]'
4343 ]
44- if 'arm64' == machine :
45- args += ['extra_cflags=["-stdlib=libc++"]' ]
46- else :
47- args += ['extra_cflags=["-stdlib=libc++", "-mmacosx-version-min=10.13"]' ]
44+ if 'x64' == machine :
45+ args += ['extra_cflags=["-mmacosx-version-min=10.13"]' ]
4846 elif 'linux' == system :
4947 args += [
5048 'skia_use_system_freetype2=true' ,
@@ -89,14 +87,16 @@ def main():
8987
9088 # Extract all unique defines from ninja commands
9189 ninja_commands = subprocess .check_output ([os .path .join ('third_party/ninja' , ninja ), '-C' , out , '-t' , 'commands' ], text = True )
92- defines = set ()
93- for match in re .finditer (r'-D(\S+)' , ninja_commands ):
94- defines .add (match .group (1 ))
95- defines_file = os .path .join (out , 'defines.cmake' )
96- with open (defines_file , 'w' ) as f :
90+ defines = {}
91+ for match in re .finditer (r'-D([^ =]+)(?:=(\S+))?' , ninja_commands ):
92+ defines [match .group (1 )] = match .group (2 )
93+ with open (os .path .join (out , 'defines.cmake' ), 'w' ) as f :
9794 f .write ('add_definitions(\n ' )
98- for define in sorted (defines ):
99- f .write (' -D' + define .replace ('\\ ' , '' ) + '\n ' )
95+ for key , value in sorted (defines .items ()):
96+ if value is None :
97+ f .write (f' -D{ key } \n ' )
98+ else :
99+ f .write (f' -D{ key } ={ value .replace ('\\ ' , '' )} \n ' )
100100 f .write (')\n ' )
101101
102102 return 0
0 commit comments