Skip to content

Commit 59a924d

Browse files
authored
Fix broken ndk version caching (#1204)
This function would just store the version of the last checked ndk path, so it would return the wrong value if this is not the same ndk path that was last checked. It now only reuses the version value if the path was the same.
1 parent 75108a5 commit 59a924d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tools/hxcpp/Setup.hx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,14 @@ class Setup
125125
}
126126

127127
static var gotNdkVersion = 0.0;
128+
static var cachedNdkPath:Null<String> = null;
128129
static public function getNdkVersion(inDirName:String, newStyle=false):Float
129130
{
130-
if (gotNdkVersion!=0)
131+
if (gotNdkVersion!=0 && cachedNdkPath==inDirName)
131132
return gotNdkVersion;
132133

134+
cachedNdkPath = inDirName;
135+
133136
Log.v("Try to get version from source.properties");
134137
var src = toPath(inDirName+"/source.properties");
135138
if (sys.FileSystem.exists(src))

0 commit comments

Comments
 (0)