adam-mcdaniel/oakc

Compiler will only use the C target

Closed this issue · 3 comments

This can be seen by adding println!("Using C target"); to the top of the compile function in src/target/c.rs, rebuilding, and then running ./target/debug/oak -g c <any Oak file>.

Seems to work fine on my repo. Are you sure you merged in the latest changes from upstream? I also suggest using cargo run -- -g ./examples/hello_world.ok. It will build the binary if there are any changes and then pass everything after -- to the oak binary.

I'm able to reproduce this and I've found the source of the error. In bin.rs, the argument parser matches the -c flag (to use the C backend) against the c compiler switch (to compile the file) for some reason. I'm issuing a fix for this.

I'm sorry it took so long to merge, but PR #54 fixed this issue.