Skip to content

Commit

Permalink
Merge branch 'main' of github.com:ysthakur/fred
Browse files Browse the repository at this point in the history
  • Loading branch information
ysthakur committed Dec 17, 2024
2 parents b98c73f + 57ee692 commit 07a34e0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/main/scala/fred/Compiler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,9 @@ object Compiler {
.getResourceAsStream(RuntimeHeader)
val io = ProcessIO(
in => {
in.write(generated.getBytes())
// in.write(runtimeHeader.readAllBytes())
in.write(runtimeHeader.readAllBytes())
// TODO removing #include runtime.h is a horrendous hack
// in.write(generated.replaceAll("#include \"runtime.h\"", "").getBytes())
in.write(generated.replaceAll("#include \"runtime.h\"", "").getBytes())
in.close()
},
out => print(String(out.readAllBytes())),
Expand All @@ -89,7 +88,7 @@ object Compiler {
val extraIncludes =
if (settings.includeMemcheck) "-I /usr/include/valgrind" else ""

assert(s"gcc -g -I ${includesFolder()} $extraIncludes -o $outExe -x c -".run(io).exitValue() == 0)
assert(s"gcc -g $extraIncludes -o $outExe -x c -".run(io).exitValue() == 0)
File(outExe).setExecutable(true)

runtimeHeader.close()
Expand Down

0 comments on commit 07a34e0

Please sign in to comment.