Skip to content

Commit

Permalink
fix: leanc: complex LEAN_CC
Browse files Browse the repository at this point in the history
  • Loading branch information
Kha committed Oct 6, 2021
1 parent e02dc66 commit 82d0628
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Leanc.lean
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ Beware of the licensing consequences since GMP is LGPL."
let mut cc := (← IO.getEnv "LEAN_CC").getD "@LEANC_CC@"
if cc.startsWith "." then
cc := (binDir / cc).toString

let args := cflags ++ args ++ ldflagsExt ++ ldflags ++ ["-Wno-unused-command-line-argument"]
-- support `LEANC_CC='ccache cc'`
let cc' :: ccArgs ← cc.trim.splitOn | throw <| IO.userError "LEAN_CC is empty"
let args := ccArgs ++ cflags ++ args ++ ldflagsExt ++ ldflags ++ ["-Wno-unused-command-line-argument"]
if args.contains "-v" then
IO.eprintln s!"{cc} {" ".intercalate args}"
let child ← IO.Process.spawn { cmd := cc, args := args.toArray }
IO.eprintln s!"{cc'} {" ".intercalate args}"
let child ← IO.Process.spawn { cmd := cc', args := args.toArray }
child.wait

0 comments on commit 82d0628

Please sign in to comment.