lcompilers / lc

C++ compiler
MIT License
26 stars 7 forks source link

Fix running `lc` in sub directory #93

Closed Shaikh-Ubaid closed 9 months ago

Shaikh-Ubaid commented 9 months ago

fixes https://github.com/lcompilers/lc/issues/32

main branch:

lc % cd examples 
examples % lc expr2.c 
ld: warning: directory not found for option '-Lsrc/bin/../runtime'
ld: library not found for -llc_runtime
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The command 'gcc -o expr2.out expr2.out__generated__.o  -L"src/bin/../runtime" -Wl,-rpath,"src/bin/../runtime" -llc_runtime -lm' failed.
examples % echo $?
10

PR branch:

lc % cd examples 
examples % lc expr2.c 
25