Skip to content

Commit

Permalink
Set CMAKE_GENERATOR_TOOLSET
Browse files Browse the repository at this point in the history
  • Loading branch information
justsmth committed Jul 2, 2024
1 parent 65bb3bf commit e62fc09
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions aws-lc-sys/builder/cmake_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,14 @@ impl CmakeBuilder {
cmake_cfg.define("CMAKE_SYSTEM_NAME", "");
cmake_cfg.define("CMAKE_SYSTEM_PROCESSOR", "");
}
if target_arch() == "aarch64" && target_env() == "msvc" {
#[cfg(target_arch = "x86_64")]
cmake_cfg.generator_toolset("ClangCL,host=x64");
#[cfg(target_arch = "x86")]
cmake_cfg.generator_toolset("ClangCL,host=x86");
#[cfg(not(any(target_arch = "x86_64", target_arch = "x86")))]
cmake_cfg.generator_toolset("ClangCL");
}
}

if target_vendor() == "apple" {
Expand All @@ -167,13 +175,6 @@ impl CmakeBuilder {
}
}

// Only needed when cross-compiling
if target_underscored() == "aarch64_pc_windows_msvc" {
cmake_cfg.generator("Ninja");
cmake_cfg.define("CMAKE_ASM_COMPILER_TARGET", "arm64-pc-windows-msvc");
cmake_cfg.define("CMAKE_ASM_COMPILER", "clang-cl");
}

if target_env() == "ohos" {
const OHOS_NDK_HOME: &str = "OHOS_NDK_HOME";
if let Ok(ndk) = env::var(OHOS_NDK_HOME) {
Expand Down

0 comments on commit e62fc09

Please sign in to comment.