File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import std.stdio;
66import std.string ;
77import std.process ;
88import std.algorithm ;
9+ import callisto.error;
910import callisto.compiler;
1011import callisto.language;
1112import callisto.codeRemover;
@@ -75,7 +76,7 @@ int main(string[] args) {
7576 bool optimise;
7677 string [] versions;
7778 bool runFinal = true ;
78- CompilerBackend backend = new BackendX86_64() ;
79+ CompilerBackend backend;
7980 bool doDebug;
8081 bool debugParser;
8182 bool exportSymbols;
@@ -87,6 +88,17 @@ int main(string[] args) {
8788 bool assemblyLines;
8889 string os = " DEFAULT" ;
8990
91+ // choose default backend
92+ version (X86_64 ) {
93+ backend = new BackendX86_64();
94+ }
95+ else version (AArch64 ) {
96+ backend = new BackendARM64();
97+ }
98+ else {
99+ WarnNoInfo(" No default backend for your system" );
100+ }
101+
90102 for (size_t i = 1 ; i < args.length; ++ i) {
91103 if (args[i][0 ] == ' -' ) {
92104 switch (args[i]) {
@@ -291,6 +303,10 @@ int main(string[] args) {
291303 }
292304 }
293305
306+ if (backend is null ) {
307+ ErrorNoInfo(" No backend selected" );
308+ }
309+
294310 if (os == " DEFAULT" ) {
295311 os = backend.defaultOS;
296312 }
You can’t perform that action at this time.
0 commit comments