2
0
Эх сурвалжийг харах

[hlc] prevent recursive template/code copy

Yuxiao Mao 10 сар өмнө
parent
commit
812a3e4cd5
1 өөрчлөгдсөн 4 нэмэгдсэн , 1 устгасан
  1. 4 1
      other/haxelib/Run.hx

+ 4 - 1
other/haxelib/Run.hx

@@ -67,7 +67,10 @@ class Build {
 			if( !sys.FileSystem.exists(srcDir) )
 				throw "Failed to find make template '"+tpl+"'";
 		}
-		
+		if( StringTools.contains(sys.FileSystem.absolutePath(targetDir), sys.FileSystem.absolutePath(srcDir)) ) {
+			throw "Template "+tpl+" contains "+targetDir+", can cause recursive generation";
+		}
+
 		var allFiles = config.files.copy();
 		for( f in config.files )
 			if( StringTools.endsWith(f,".c") ) {