浏览代码

Fixed incbin only in included file issue.

woollybah 7 年之前
父节点
当前提交
bcc7bffb4e
共有 2 个文件被更改,包括 12 次插入5 次删除
  1. 11 5
      bmk_make.bmx
  2. 1 0
      bmk_modutil.bmx

+ 11 - 5
bmk_make.bmx

@@ -714,8 +714,12 @@ Type TBuildManager Extends TCallback
 			Next
 			Next
 
 
 			Local ib:TSourceFile
 			Local ib:TSourceFile
-			If processor.BCCVersion() <> "BlitzMax" And Not source.isInclude And Not source.incbins.IsEmpty() Then
-				ib = CreateIncBin(source)
+			If processor.BCCVersion() <> "BlitzMax" And Not source.incbins.IsEmpty() Then
+				If source.owner_path Then
+					ib = CreateIncBin(source, source.owner_path)
+				Else
+					ib = CreateIncBin(source, source.path)
+				End If
 			End If
 			End If
 
 
 			For Local f:String = EachIn source.imports
 			For Local f:String = EachIn source.imports
@@ -838,6 +842,8 @@ Type TBuildManager Extends TCallback
 
 
 				Local s:TSourceFile = GetSourceFile(path, isMod, rebuildImports, True)
 				Local s:TSourceFile = GetSourceFile(path, isMod, rebuildImports, True)
 				If s Then
 				If s Then
+					s.owner_path = source.path
+					
 					' calculate included file dependencies
 					' calculate included file dependencies
 					CalculateDependencies(s, isMod, rebuildImports)
 					CalculateDependencies(s, isMod, rebuildImports)
 
 
@@ -1204,15 +1210,15 @@ Type TBuildManager Extends TCallback
 		Return gen
 		Return gen
 	End Method
 	End Method
 
 
-	Method CreateIncBin:TSourceFile(source:TSourceFile)
+	Method CreateIncBin:TSourceFile(source:TSourceFile, sourcePath:String)
 	
 	
-		Local path:String = StripDir(source.path) + opt_configmung +  processor.CPU() + ".incbin.c"
+		Local path:String = StripDir(sourcePath) + opt_configmung +  processor.CPU() + ".incbin.c"
 
 
 		Local ib:TSourceFile = GetSourceFile(path)
 		Local ib:TSourceFile = GetSourceFile(path)
 		
 		
 		If Not ib Then
 		If Not ib Then
 			ib = New TSourceFile
 			ib = New TSourceFile
-			ib.path = ExtractDir(source.path) + "/.bmx/" + path
+			ib.path = ExtractDir(sourcePath) + "/.bmx/" + path
 			ib.obj_path = StripExt(ib.path) + ".o"
 			ib.obj_path = StripExt(ib.path) + ".o"
 			ib.ext = "c"
 			ib.ext = "c"
 			ib.exti = String(processor.RunCommand("source_type", [ib.ext])).ToInt()
 			ib.exti = String(processor.RunCommand("source_type", [ib.ext])).ToInt()

+ 1 - 0
bmk_modutil.bmx

@@ -83,6 +83,7 @@ Type TSourceFile
 	Field maxIfaceTimeCache:Int = -1
 	Field maxIfaceTimeCache:Int = -1
 	
 	
 	Field isInclude:Int
 	Field isInclude:Int
+	Field owner_path:String
 	
 	
 	' add cc_opts or ld_opts
 	' add cc_opts or ld_opts
 	Method AddModOpt(opt:String)
 	Method AddModOpt(opt:String)