fix llvm linking
This commit is contained in:
parent
6c3d20bbbb
commit
243e3cc694
3 changed files with 11 additions and 2 deletions
|
@ -6,7 +6,9 @@ pub fn build(b: *Builder) void {
|
|||
exe.setBuildMode(mode);
|
||||
exe.install();
|
||||
|
||||
exe.linkSystemLibrary("c");
|
||||
exe.linkSystemLibrary("LLVM-8");
|
||||
exe.linkSystemLibrary("stdc++");
|
||||
|
||||
const run_cmd = exe.run();
|
||||
run_cmd.step.dependOn(b.getInstallStep());
|
||||
|
|
|
@ -62,10 +62,12 @@ pub const Codegen = struct {
|
|||
}
|
||||
|
||||
pub fn gen(self: *Codegen, root: *ast.Node) !void {
|
||||
//std.debug.warn("cgen: init native target\n");
|
||||
//_ = llvm.LLVMInitializeNativeTarget();
|
||||
std.debug.warn("cgen: start gen\n");
|
||||
var mod = llvm.LLVMModuleCreateWithName(c"awoo");
|
||||
|
||||
var mod = llvm.LLVMModuleCreateWithName(c"awoo").?;
|
||||
defer llvm.LLVMDisposeModule(mod);
|
||||
std.debug.warn("cgen: got mod\n");
|
||||
|
||||
for (root.Root.toSlice()) |child| {
|
||||
std.debug.warn("cgen: gen child {}\n", child);
|
||||
|
|
|
@ -6,6 +6,11 @@ pub const llvm = @cImport({
|
|||
@cInclude("llvm-c/Target.h");
|
||||
@cInclude("llvm-c/Analysis.h");
|
||||
@cInclude("llvm-c/BitWriter.h");
|
||||
|
||||
@cDefine("_GNU_SOURCE", {});
|
||||
@cDefine("__STDC_CONSTANT_MACROS", {});
|
||||
@cDefine("__STDC_FORMAT_MACROS", {});
|
||||
@cDefine("__STDC_LIMIT_MACROS", {});
|
||||
});
|
||||
|
||||
usingnamespace llvm;
|
||||
|
|
Loading…
Reference in a new issue