diff options
| author | gingerBill <bill@gingerbill.org> | 2020-03-19 15:14:31 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2020-03-19 15:14:31 +0000 |
| commit | ed4d21045b563e2066fa5599cc626b489523fcad (patch) | |
| tree | 2712a83454dfe3c7116bce3e2f05cfc57c3fe54f /src/main.cpp | |
| parent | 93955a0fd8b8387b08a314649b8b705bdfc8c9d2 (diff) | |
Add `LLVM_BACKEND_SUPPORT` macro to make the backend optional
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index 8113162e5..caad1c901 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -18,7 +18,10 @@ gb_global Timings global_timings = {0}; #include "docs.cpp" #include "checker.cpp" + +#if defined(LLVM_BACKEND_SUPPORT) #include "llvm_backend.cpp" +#endif #include "ir.cpp" #include "ir_opt.cpp" @@ -126,6 +129,7 @@ i32 system_exec_command_line_app(char const *name, char const *fmt, ...) { +#if defined(LLVM_BACKEND_SUPPORT) i32 linker_stage(lbGenerator *gen) { i32 exit_code = 0; @@ -420,7 +424,7 @@ i32 linker_stage(lbGenerator *gen) { return exit_code; } - +#endif Array<String> setup_args(int argc, char const **argv) { gbAllocator a = heap_allocator(); @@ -1586,6 +1590,8 @@ int main(int arg_count, char const **arg_ptr) { } if (build_context.use_llvm_api) { +#if defined(LLVM_BACKEND_SUPPORT) + timings_start_section(timings, str_lit("LLVM API Code Gen")); lbGenerator gen = {}; if (!lb_init_generator(&gen, &checker)) { @@ -1616,6 +1622,10 @@ int main(int arg_count, char const **arg_ptr) { } return 0; +#else + gb_printf_err("LLVM C API backend is not supported on this platform yet\n"); + return 1; +#endif } else { irGen ir_gen = {0}; if (!ir_gen_init(&ir_gen, &checker)) { |