From 068fbbfb2fa8408d4a4be93dc87dbbfb2d1fc21d Mon Sep 17 00:00:00 2001 From: partouf Date: Thu, 21 Jul 2022 23:12:37 +0200 Subject: [PATCH] fix for pre v11 nvcc --- lib/compilers/nvcc.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/compilers/nvcc.js b/lib/compilers/nvcc.js index a3d07a9dc..7e3a2f048 100644 --- a/lib/compilers/nvcc.js +++ b/lib/compilers/nvcc.js @@ -24,8 +24,11 @@ import path from 'path'; +import Semver from 'semver'; + import {BaseCompiler} from '../base-compiler'; import {SassAsmParser} from '../parsers/asm-parser-sass'; +import {asSafeVer} from '../utils'; import {ClangParser} from './argument-parsers'; @@ -55,8 +58,12 @@ export class NvccCompiler extends BaseCompiler { } async objdump(outputFilename, result, maxSize) { - // For nvdisasm. - const args = [outputFilename, '-c', '-g', '-hex']; + let args = [outputFilename, '-c', '-g', '-hex']; + + if (Semver.lt(asSafeVer(this.compiler.semver), '11.0.0', true)) { + args = [outputFilename, '-c', '-g']; + } + const execOptions = {maxOutput: maxSize, customCwd: path.dirname(outputFilename)}; const objResult = await this.exec(this.compiler.objdumper, args, execOptions);