Skip to content

Commit

Permalink
Flag -xassembler-with-cpp on Apple
Browse files Browse the repository at this point in the history
  • Loading branch information
justsmth committed Feb 26, 2024
1 parent c9b3518 commit 254d5c8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion aws-lc-sys/builder/cc_builder.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR ISC

use crate::{target, target_os, OutputLibType};
use crate::{target, target_os, target_vendor, OutputLibType};
use std::path::PathBuf;

pub(crate) struct CcBuilder {
Expand Down Expand Up @@ -94,6 +94,8 @@ impl crate::Builder for CcBuilder {
.file(self.manifest_dir.join("rust_wrapper.c"));
if target_os() == "linux" {
cc_build.define("_XOPEN_SOURCE", "700").flag("-lpthread");
} else if target_vendor() == "apple" {
cc_build.asm_flag("-xassembler-with-cpp");
}

for source in &lib.sources {
Expand Down
4 changes: 4 additions & 0 deletions scripts/build/generate_build_toml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ function find_generated_src_dir() {
exit 1
fi
ARCH_NAME=$(uname -m)
if [[ "${ARCH_NAME}" == arm64 && ${OS_NAME} == "mac" ]]; then
OS_NAME=ios
ARCH_NAME=aarch64
fi
echo "${OS_NAME}-${ARCH_NAME}"
}

Expand Down

0 comments on commit 254d5c8

Please sign in to comment.