Skip to content

Commit

Permalink
Merge pull request #160 from expressvpn/cvpn-939-x86-flag
Browse files Browse the repository at this point in the history
  • Loading branch information
kp-mariappan-ramasamy authored Jul 18, 2024
2 parents 9f5d3b3 + faa16af commit 456d726
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions wolfssl-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,23 +144,28 @@ fn build_wolfssl(wolfssl_src: &Path) -> PathBuf {
}
}

if build_target::target_arch().unwrap() == build_target::Arch::X86_64 {
// Enable Intel ASM optmisations
conf.enable("intelasm", None);
// Enable AES hardware acceleration
conf.enable("aesni", None);
}

if build_target::target_arch().unwrap() == build_target::Arch::AARCH64 {
// Enable ARM ASM optimisations
conf.enable("armasm", None);
}

if build_target::target_arch().unwrap() == build_target::Arch::ARM {
// Enable ARM ASM optimisations, except for android armeabi-v7a
if build_target::target_os().unwrap() != build_target::Os::Android {
match build_target::target_arch().unwrap() {
build_target::Arch::AARCH64 => {
// Enable ARM ASM optimisations
conf.enable("armasm", None);
}
build_target::Arch::ARM => {
// Enable ARM ASM optimisations, except for android armeabi-v7a
if build_target::target_os().unwrap() != build_target::Os::Android {
conf.enable("armasm", None);
}
}
build_target::Arch::X86 => {
// Disable sp asm optmisations which has been enabled earlier
conf.disable("sp-asm", None);
}
build_target::Arch::X86_64 => {
// Enable Intel ASM optmisations
conf.enable("intelasm", None);
// Enable AES hardware acceleration
conf.enable("aesni", None);
}
_ => {}
}

if build_target::target_os().unwrap() == build_target::Os::Android {
Expand Down

0 comments on commit 456d726

Please sign in to comment.