@@ -134,22 +134,17 @@ pub fn command(options: Options) -> Result<()> {
134134
135135 let isysroot = format ! ( "-isysroot {}" , options. sdk_root. display( ) ) ;
136136
137- // when using Xcode, the arches will be ['Simulator', 'arm64'] instead of ['arm64-sim']
138- let arches = if options. arches . contains ( & "Simulator" . into ( ) ) {
139- vec ! [ if cfg!( target_arch = "aarch64" ) {
140- "arm64-sim" . to_string( )
141- } else {
142- "x86_64" . to_string( )
143- } ]
144- } else {
145- options. arches
146- } ;
147- for arch in arches {
137+ for arch in options. arches {
148138 // Set target-specific flags
149139 let ( env_triple, rust_triple) = match arch. as_str ( ) {
150140 "arm64" => ( "aarch64_apple_ios" , "aarch64-apple-ios" ) ,
151141 "arm64-sim" => ( "aarch64_apple_ios_sim" , "aarch64-apple-ios-sim" ) ,
152142 "x86_64" => ( "x86_64_apple_ios" , "x86_64-apple-ios" ) ,
143+ "Simulator" => {
144+ // when using Xcode, the arches for a simulator build will be ['Simulator', 'arm64-sim'] instead of ['arm64-sim']
145+ // so we ignore that on our end
146+ continue ;
147+ }
153148 _ => {
154149 return Err ( anyhow:: anyhow!(
155150 "Arch specified by Xcode was invalid. {} isn't a known arch" ,
@@ -206,14 +201,11 @@ pub fn command(options: Options) -> Result<()> {
206201 }
207202
208203 let project_dir = config. project_dir ( ) ;
209- std:: fs:: create_dir_all ( project_dir. join ( format ! ( "Externals/{}" , profile. as_str( ) ) ) ) ?;
204+ let externals_lib_dir = project_dir. join ( format ! ( "Externals/{arch}/{}" , profile. as_str( ) ) ) ;
205+ std:: fs:: create_dir_all ( & externals_lib_dir) ?;
210206 std:: fs:: copy (
211207 lib_path,
212- project_dir. join ( format ! (
213- "Externals/{}/lib{}.a" ,
214- profile. as_str( ) ,
215- config. app( ) . lib_name( )
216- ) ) ,
208+ externals_lib_dir. join ( format ! ( "lib{}.a" , config. app( ) . lib_name( ) ) ) ,
217209 ) ?;
218210 }
219211 Ok ( ( ) )
0 commit comments