test: fix nan tests on macOS (#47607)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
parent
9aedb9c1f4
commit
bbf8003f0f
1 changed files with 11 additions and 8 deletions
|
@ -46,20 +46,23 @@ async function main () {
|
|||
const platformFlags = [];
|
||||
if (process.platform === 'darwin') {
|
||||
const sdkPath = path.resolve(BASE, 'out', outDir, 'sdk', 'xcode_links');
|
||||
const sdks = (await fs.promises.readdir(sdkPath)).filter(fileName => fileName.endsWith('.sdk'));
|
||||
const sdkToUse = sdks[0];
|
||||
if (!sdkToUse) {
|
||||
const sdks = (await fs.promises.readdir(sdkPath)).filter(f => f.endsWith('.sdk'));
|
||||
|
||||
if (!sdks.length) {
|
||||
console.error('Could not find an SDK to use for the NAN tests');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
if (sdks.length) {
|
||||
console.warn(`Multiple SDKs found in the xcode_links directory - using ${sdkToUse}`);
|
||||
const sdkToUse = sdks.sort((a, b) => {
|
||||
const getVer = s => s.match(/(\d+)\.?(\d*)/)?.[0] || '0';
|
||||
return getVer(b).localeCompare(getVer(a), undefined, { numeric: true });
|
||||
})[0];
|
||||
|
||||
if (sdks.length > 1) {
|
||||
console.warn(`Multiple SDKs found - using ${sdkToUse}`);
|
||||
}
|
||||
|
||||
platformFlags.push(
|
||||
`-isysroot ${path.resolve(sdkPath, sdkToUse)}`
|
||||
);
|
||||
platformFlags.push(`-isysroot ${path.resolve(sdkPath, sdkToUse)}`);
|
||||
}
|
||||
|
||||
// TODO(ckerr) this is cribbed from read obj/electron/electron_app.ninja.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue