diff options
author | Michael Debertol <michael.debertol@gmail.com> | 2022-02-13 20:06:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-13 20:06:51 +0100 |
commit | f0f744d0722c9f954d6121b2be4ef29a0478c2ba (patch) | |
tree | 9eef686460c1a12d01dd753775dfb411bc99362f /lib/compilers/dart.js | |
parent | c432d624b95cc1b0420821c5dddb69d8fcdf7737 (diff) | |
download | compiler-explorer-f0f744d0722c9f954d6121b2be4ef29a0478c2ba.tar.gz compiler-explorer-f0f744d0722c9f954d6121b2be4ef29a0478c2ba.zip |
Add more dart versions (#3361)gh-1960
Diffstat (limited to 'lib/compilers/dart.js')
-rw-r--r-- | lib/compilers/dart.js | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/lib/compilers/dart.js b/lib/compilers/dart.js index 88bedd097..17f36902c 100644 --- a/lib/compilers/dart.js +++ b/lib/compilers/dart.js @@ -22,6 +22,7 @@ // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. +import Semver from 'semver'; import { DartAsmParser } from '../asm-parser-dart'; import { BaseCompiler } from '../base-compiler'; import * as utils from '../utils'; @@ -56,11 +57,19 @@ export class DartCompiler extends BaseCompiler { filters.libraryCode = true; // Dart doesn't support emitting assembly filters.binary = true; - return [ - 'compile', - 'aot-snapshot', - '-o', this.filename(outputFilename), - ]; + + const dartCompileIntroduction = '2.10.0'; + if (Semver.lt(this.compiler.semver, dartCompileIntroduction)) { + return [ + '-k', 'aot', + '-o', this.filename(outputFilename), + ]; + } else { + return [ + 'compile', 'aot-snapshot', + '-o', this.filename(outputFilename), + ]; + } } getArgumentParser() { |