Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b312d7e

Browse files
committed
Allow Options.txt to be missing
1 parent aab1ee7 commit b312d7e

1 file changed

Lines changed: 23 additions & 22 deletions

File tree

tools/hxcpp/BuildTool.hx

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -999,32 +999,33 @@ class BuildTool
999999
if ( optionsTxt!="" && makefile!="")
10001000
{
10011001
var path = PathManager.combine(haxe.io.Path.directory(makefile), optionsTxt);
1002-
try
1003-
{
1004-
var contents = sys.io.File.getContent(path);
1005-
if (contents.substr(0,1)!=" ") // Is it New-style?
1006-
for(def in contents.split("\n"))
1007-
{
1008-
var equals = def.indexOf("=");
1009-
if (equals>0)
1002+
if (FileSystem.exists(path))
1003+
try
1004+
{
1005+
var contents = sys.io.File.getContent(path);
1006+
if (contents.substr(0,1)!=" ") // Is it New-style?
1007+
for(def in contents.split("\n"))
10101008
{
1011-
var name = def.substr(0,equals);
1012-
var value = def.substr(equals+1);
1013-
if (name=="hxcpp")
1009+
var equals = def.indexOf("=");
1010+
if (equals>0)
10141011
{
1015-
// Ignore
1012+
var name = def.substr(0,equals);
1013+
var value = def.substr(equals+1);
1014+
if (name=="hxcpp")
1015+
{
1016+
// Ignore
1017+
}
1018+
else if (name=="destination")
1019+
destination = value;
1020+
else
1021+
defines.set(name,value);
10161022
}
1017-
else if (name=="destination")
1018-
destination = value;
1019-
else
1020-
defines.set(name,value);
10211023
}
1022-
}
1023-
}
1024-
catch(e:Dynamic)
1025-
{
1026-
Log.error('Could not parse options file $path ($e)');
1027-
}
1024+
}
1025+
catch(e:Dynamic)
1026+
{
1027+
Log.error('Could not parse options file $path ($e)');
1028+
}
10281029
}
10291030

10301031
Setup.initHXCPPConfig(defines);

0 commit comments

Comments
 (0)