Skip to content

Commit

Permalink
Update NDK toolchain finder (compiler-explorer#6461)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mefiresu authored May 10, 2024
1 parent 44d48dc commit a71168c
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions lib/compiler-finder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -466,17 +466,14 @@ export class CompilerFinder {
for (const [langId, ndkPath] of Object.entries(ndkPaths)) {
if (ndkPath) {
const toolchains = fs.readdirSync(`${ndkPath}/toolchains`);
for (const [version, index] of toolchains) {
const path = `${ndkPath}/toolchains/${version}/prebuilt/linux-x86_64/bin/`;
if (fs.existsSync(path)) {
const cc = fs.readdirSync(path).find(filename => filename.includes('g++'));
toolchains[index] = path + cc;
} else {
toolchains[index] = null;
for (const version of toolchains) {
const path = `${ndkPath}/toolchains/${version}/prebuilt/linux-x86_64/bin`;
for (const exe of fs.readdirSync(path)) {
if (exe.endsWith('clang++') || exe.endsWith('g++')) {
langToCompilers[langId].push(`${path}/${exe}`);
}
}
}
// TODO: Something awful is going on with the type of toolchains here
langToCompilers[langId].push(toolchains.filter(x => x !== null));
}
}
}
Expand Down

0 comments on commit a71168c

Please sign in to comment.