@@ -894,7 +894,11 @@ class BuildTool
894894 if (valid (el ," " ))
895895 switch (el .name )
896896 {
897- case " flag" : c .addFlag (substitute (el .att .value ), el .has .tag ? substitute (el .att .tag ): " " );
897+ case " flag" :
898+ var tag = el .has .tag ? substitute (el .att .tag ): " " ;
899+ if (el .has .name )
900+ c .addFlag (substitute (el .att .name ), tag );
901+ c .addFlag (substitute (el .att .value ), tag );
898902 case " cflag" : c .mCFlags .push (substitute (el .att .value ));
899903 case " cppflag" : c .mCPPFlags .push (substitute (el .att .value ));
900904 case " objcflag" : c .mOBJCFlags .push (substitute (el .att .value ));
@@ -1090,7 +1094,10 @@ class BuildTool
10901094 if (valid (el ," " ))
10911095 switch (el .name )
10921096 {
1093- case " flag" : l .mFlags .push (substitute (el .att .value ));
1097+ case " flag" :
1098+ if (el .has .name )
1099+ l .mFlags .push (substitute (el .att .name ));
1100+ l .mFlags .push (substitute (el .att .value ));
10941101 case " ext" : l .mExt = (substitute (el .att .value ));
10951102 case " outflag" : l .mOutFlag = (substitute (el .att .value ));
10961103 case " libdir" : l .mLibDir = (substitute (el .att .name ));
@@ -1150,17 +1157,17 @@ class BuildTool
11501157 if (valid (el ," " ))
11511158 switch (el .name )
11521159 {
1153- case " flag" : s .mFlags .push (substitute (el .att .value ));
1154- case " outPre" : s .mOutPre = substitute (el .att .value );
1155- case " outPost" : s .mOutPost = substitute (el .att .value );
1160+ case " flag" :
1161+ if (el .has .name )
1162+ s .mFlags .push (substitute (el .att .name ));
1163+ s .mFlags .push (substitute (el .att .value ));
11561164 case " exe" : s .mExe = substitute ((el .att .name ));
11571165 }
11581166 }
11591167
11601168 return s ;
11611169 }
11621170
1163-
11641171 public function createStripper (inXML : XmlAccess ,inBase : Stripper ): Stripper
11651172 {
11661173 var s = (inBase != null && ! inXML .has .replace ) ? inBase :
@@ -1170,7 +1177,10 @@ class BuildTool
11701177 if (valid (el ," " ))
11711178 switch (el .name )
11721179 {
1173- case " flag" : s .mFlags .push (substitute (el .att .value ));
1180+ case " flag" :
1181+ if (el .has .name )
1182+ s .mFlags .push (substitute (el .att .name ));
1183+ s .mFlags .push (substitute (el .att .value ));
11741184 case " exe" : s .mExe = substitute ((el .att .name ));
11751185 }
11761186 }
@@ -1238,7 +1248,10 @@ class BuildTool
12381248 target .mLibs .push (lib );
12391249 }
12401250
1241- case " flag" : target .mFlags .push ( substitute (el .att .value ) );
1251+ case " flag" :
1252+ if (el .has .name )
1253+ target .mFlags .push ( substitute (el .att .name ) );
1254+ target .mFlags .push ( substitute (el .att .value ) );
12421255 case " depend" : target .mDepends .push ( substitute (el .att .name ) );
12431256 case " vflag" :
12441257 target .mFlags .push ( substitute (el .att .name ) );
@@ -2334,7 +2347,7 @@ class BuildTool
23342347 public function checkToolVersion (inVersion : String )
23352348 {
23362349 var ver = Std .parseInt (inVersion );
2337- if (ver > 4 )
2350+ if (ver > 5 )
23382351 Log .error (" Your version of hxcpp.n is out-of-date. Please update by compiling 'haxe compile.hxml' in hxcpp/tools/hxcpp." );
23392352 }
23402353
0 commit comments