mirror of
https://github.com/esp-rs/espup.git
synced 2025-09-27 04:40:27 +00:00
Add llvm 19 support (#477)
* feat: Add llvm 19 support * docs: Update changelog
This commit is contained in:
parent
236ad275b8
commit
0a8ac1b6c8
@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
- Add support for LLVM esp-19.1.2_20250211 (#477)
|
||||
|
||||
### Fixed
|
||||
- Return an error if GET request fails (#471)
|
||||
|
@ -27,6 +27,7 @@ const OLD_LLVM_16_VERSION: &str = "esp-16.0.0-20230516";
|
||||
const DEFAULT_LLVM_16_VERSION: &str = "esp-16.0.4-20231113";
|
||||
const DEFAULT_LLVM_17_VERSION: &str = "esp-17.0.1_20240419";
|
||||
const DEFAULT_LLVM_18_VERSION: &str = "esp-18.1.2_20240912";
|
||||
const DEFAULT_LLVM_19_VERSION: &str = "esp-19.1.2_20250211";
|
||||
pub const CLANG_NAME: &str = "xtensa-esp32-elf-clang";
|
||||
|
||||
#[derive(Debug, Clone, Default)]
|
||||
@ -50,7 +51,10 @@ pub struct Llvm {
|
||||
impl Llvm {
|
||||
/// Gets the name of the LLVM arch based on the host triple.
|
||||
fn get_arch(host_triple: &HostTriple, version: &str) -> String {
|
||||
if version == DEFAULT_LLVM_17_VERSION || version == DEFAULT_LLVM_18_VERSION {
|
||||
if version == DEFAULT_LLVM_17_VERSION
|
||||
|| version == DEFAULT_LLVM_18_VERSION
|
||||
|| version == DEFAULT_LLVM_19_VERSION
|
||||
{
|
||||
let arch = match host_triple {
|
||||
HostTriple::Aarch64AppleDarwin => "aarch64-apple-darwin",
|
||||
HostTriple::X86_64AppleDarwin => "x86_64-apple-darwin",
|
||||
@ -121,11 +125,18 @@ impl Llvm {
|
||||
|| (major == 1 && minor < 81)
|
||||
{
|
||||
DEFAULT_LLVM_17_VERSION.to_string()
|
||||
} else {
|
||||
} else if (major == 1 && minor == 84 && patch == 0 && subpatch == 0)
|
||||
|| (major == 1 && minor < 84)
|
||||
{
|
||||
DEFAULT_LLVM_18_VERSION.to_string()
|
||||
} else {
|
||||
DEFAULT_LLVM_19_VERSION.to_string()
|
||||
};
|
||||
|
||||
let name = if version == DEFAULT_LLVM_17_VERSION || version == DEFAULT_LLVM_18_VERSION {
|
||||
let name = if version == DEFAULT_LLVM_17_VERSION
|
||||
|| version == DEFAULT_LLVM_18_VERSION
|
||||
|| version == DEFAULT_LLVM_19_VERSION
|
||||
{
|
||||
"clang-"
|
||||
} else {
|
||||
"llvm-"
|
||||
@ -139,8 +150,10 @@ impl Llvm {
|
||||
Self::get_arch(host_triple, &version)
|
||||
);
|
||||
|
||||
let file_name_libs =
|
||||
if version != DEFAULT_LLVM_17_VERSION && version != DEFAULT_LLVM_18_VERSION {
|
||||
let file_name_libs = if version != DEFAULT_LLVM_17_VERSION
|
||||
&& version != DEFAULT_LLVM_18_VERSION
|
||||
&& version != DEFAULT_LLVM_19_VERSION
|
||||
{
|
||||
format!("libs_{file_name_full}")
|
||||
} else {
|
||||
format!("libs-{file_name_full}")
|
||||
@ -229,6 +242,14 @@ impl Llvm {
|
||||
),
|
||||
"",
|
||||
);
|
||||
updated_path = updated_path.replace(
|
||||
&format!(
|
||||
"{}\\{}\\esp-clang\\bin;",
|
||||
llvm_path.display().to_string().replace('/', "\\"),
|
||||
DEFAULT_LLVM_19_VERSION,
|
||||
),
|
||||
"",
|
||||
);
|
||||
updated_path = updated_path.replace(
|
||||
&format!(
|
||||
"{}\\esp-clang\\bin;",
|
||||
|
Loading…
x
Reference in New Issue
Block a user