Build cores without variants

This commit is contained in:
Matthias Neeracher 2014-12-08 05:35:33 +01:00 committed by Matthias Neeracher
parent 15734f3f03
commit f8d5e6d9a4
2 changed files with 12 additions and 11 deletions

View File

@ -37,11 +37,13 @@ class ASBuilder {
var corePath = "" var corePath = ""
var variantPath : NSString? var variantPath : NSString?
for hw in ASHardware.instance().directories { for hw in ASHardware.instance().directories {
corePath = hw+"/cores/"+boardProp["build.core"] corePath = hw+"/cores/"+boardProp["build.core"]!
if fileManager.fileExistsAtPath(corePath) { if fileManager.fileExistsAtPath(corePath) {
if boardProp["build.variant"] != "" { if let variantName = boardProp["build.variant"] {
variantPath = hw+"/variants/"+boardProp["build.variant"] variantPath = hw+"/variants/"+variantName
if !fileManager.fileExistsAtPath(corePath) { if fileManager.fileExistsAtPath(variantPath!) {
args.append("variant="+variantName)
} else {
variantPath = nil variantPath = nil
} }
} }
@ -51,16 +53,15 @@ class ASBuilder {
} }
} }
if corePath == "" { if corePath == "" {
NSLog("Unable to find core %s\n", boardProp["build.core"]) NSLog("Unable to find core %s\n", boardProp["build.core"]!)
return return
} }
args.append("project="+dir.lastPathComponent) args.append("project="+dir.lastPathComponent)
args.append("board="+board) args.append("board="+board)
args.append("mcu="+boardProp["build.mcu"]) args.append("mcu="+boardProp["build.mcu"]!)
args.append("f_cpu="+boardProp["build.f_cpu"]) args.append("f_cpu="+boardProp["build.f_cpu"]!)
args.append("max_size"+boardProp["upload.maximum_size"]) args.append("max_size"+boardProp["upload.maximum_size"]!)
args.append("core="+boardProp["build.core"]) args.append("core="+boardProp["build.core"]!)
args.append("variant="+boardProp["build.variant"])
args.append("libs="+libPath) args.append("libs="+libPath)
args.append("core_path="+corePath) args.append("core_path="+corePath)
if variantPath != nil { if variantPath != nil {

View File

@ -160,7 +160,7 @@ def compile_library(lib)
compile(lib.pathmap('lib/%f'), extrainc, *Rake::FileList[lib+"/*.{c,cpp,cp,cxx,S}", lib+"/utility/*.{c,cpp,cp,cxx,S}"]) compile(lib.pathmap('lib/%f'), extrainc, *Rake::FileList[lib+"/*.{c,cpp,cp,cxx,S}", lib+"/utility/*.{c,cpp,cp,cxx,S}"])
end end
def compile_core(core,variant) def compile_core(core,variant=nil)
list = Rake::FileList[core+"/*.{c,cpp,cp,cxx,S}"] list = Rake::FileList[core+"/*.{c,cpp,cp,cxx,S}"]
list.add(variant+"/*.{c,cpp,cp,cxx,S}") if variant list.add(variant+"/*.{c,cpp,cp,cxx,S}") if variant
compile('core', nil, list) compile('core', nil, list)