浏览代码

Fixed linkage for incbin in included sources. Fixes #103.

Brucey 4 年之前
父节点
当前提交
8b2274c343
共有 3 个文件被更改,包括 22 次插入2 次删除
  1. 4 0
      CHANGELOG
  2. 1 1
      bmk_config.bmx
  3. 17 1
      bmk_make.bmx

+ 4 - 0
CHANGELOG

@@ -1,3 +1,7 @@
+## [3.46] - 2021-03-01
+### Fixed
+ - Linkage for incbin in included sources.
+
 ## [3.45] - 2020-08-16
 ## [3.45] - 2020-08-16
 ### Added
 ### Added
  - incbin file hashing.
  - incbin file hashing.

+ 1 - 1
bmk_config.bmx

@@ -10,7 +10,7 @@ Import brl.map
 
 
 Import "stringbuffer_core.bmx"
 Import "stringbuffer_core.bmx"
 
 
-Const BMK_VERSION:String = "3.45"
+Const BMK_VERSION:String = "3.46"
 
 
 Const ALL_SRC_EXTS$="bmx;i;c;m;h;cpp;cxx;mm;hpp;hxx;s;cc;asm;S"
 Const ALL_SRC_EXTS$="bmx;i;c;m;h;cpp;cxx;mm;hpp;hxx;s;cc;asm;S"
 
 

+ 17 - 1
bmk_make.bmx

@@ -881,10 +881,22 @@ Type TBuildManager Extends TCallback
 			End If
 			End If
 
 
 			For Local f:String = EachIn source.imports
 			For Local f:String = EachIn source.imports
+
 				If f[0] <> Asc("-") Then
 				If f[0] <> Asc("-") Then
 					Local path:String = CheckPath(ExtractDir(source.path), f)
 					Local path:String = CheckPath(ExtractDir(source.path), f)
 
 
 					Local s:TSourceFile = GetSourceFile(path, isMod)
 					Local s:TSourceFile = GetSourceFile(path, isMod)
+					
+					' imported sourcefile not there? Maybe it's relative to the owner path instead?
+					' For example, an incbin as part of an included source file.
+					If Not s Then
+						Local p:String = CheckPath(ExtractDir(source.owner_path), f)
+						s = GetSourceFile(p, isMod)
+						If s Then
+							path = p
+						End If
+					End If
+					
 					If s Then
 					If s Then
 	
 	
 						If rebuildImports Then
 						If rebuildImports Then
@@ -1002,6 +1014,10 @@ Type TBuildManager Extends TCallback
 				If s Then
 				If s Then
 					s.owner_path = source.path
 					s.owner_path = source.path
 					
 					
+					If s.includePaths.IsEmpty() Then
+						s.CopyIncludePaths(source.includePaths)
+					End If
+				
 					' calculate included file dependencies
 					' calculate included file dependencies
 					CalculateDependencies(s, isMod, rebuildImports)
 					CalculateDependencies(s, isMod, rebuildImports)
 
 
@@ -1060,7 +1076,7 @@ Type TBuildManager Extends TCallback
 				End If
 				End If
 			End If
 			End If
 						
 						
-			If source.depsList Then			
+			If source.depsList Then
 				For Local s:TSourceFile = EachIn source.depsList
 				For Local s:TSourceFile = EachIn source.depsList
 					If Not Match(s.ext, "bmx") Then
 					If Not Match(s.ext, "bmx") Then
 						s.cc_opts = source.cc_opts
 						s.cc_opts = source.cc_opts