feat: add target name design
This commit is contained in:
@@ -11,7 +11,7 @@ import (
|
||||
|
||||
// GetCompileConfigByName retrieves libc compilation configuration by name
|
||||
// Returns compilation file lists and corresponding cflags
|
||||
func getLibcCompileConfigByName(baseDir, libcName string) (*compile.CompileConfig, error) {
|
||||
func getLibcCompileConfigByName(baseDir, libcName, target string) (*compile.CompileConfig, error) {
|
||||
if libcName == "" {
|
||||
return nil, fmt.Errorf("libc name cannot be empty")
|
||||
}
|
||||
@@ -19,15 +19,15 @@ func getLibcCompileConfigByName(baseDir, libcName string) (*compile.CompileConfi
|
||||
|
||||
switch libcName {
|
||||
case "picolibc":
|
||||
return libc.GetPicolibcConfig(libcDir), nil
|
||||
return libc.GetPicolibcConfig(libcDir, target), nil
|
||||
case "newlib-esp32":
|
||||
return libc.GetNewlibESP32Config(libcDir, "xtensa"), nil
|
||||
return libc.GetNewlibESP32Config(libcDir, target), nil
|
||||
default:
|
||||
return nil, fmt.Errorf("unsupported libc: %s", libcName)
|
||||
}
|
||||
}
|
||||
|
||||
func getRTCompileConfigByName(baseDir, rtName string) (*compile.CompileConfig, error) {
|
||||
func getRTCompileConfigByName(baseDir, rtName, target string) (*compile.CompileConfig, error) {
|
||||
if rtName == "" {
|
||||
return nil, fmt.Errorf("rt name cannot be empty")
|
||||
}
|
||||
@@ -35,7 +35,7 @@ func getRTCompileConfigByName(baseDir, rtName string) (*compile.CompileConfig, e
|
||||
|
||||
switch rtName {
|
||||
case "compiler-rt":
|
||||
return rtlib.GetCompilerRTConfig(rtDir, "xtensa"), nil
|
||||
return rtlib.GetCompilerRTConfig(rtDir, target), nil
|
||||
default:
|
||||
return nil, fmt.Errorf("unsupported rt: %s", rtName)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user