From 7a98e3b79efe29a8d37123d4484f14a54058b132 Mon Sep 17 00:00:00 2001 From: Aman Goel Date: Wed, 27 Sep 2023 16:40:59 -0700 Subject: [PATCH] Correct output paths with multiple targets --- Src/PCompiler/CompilerCore/Compiler.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Src/PCompiler/CompilerCore/Compiler.cs b/Src/PCompiler/CompilerCore/Compiler.cs index 1fe201ff5..29984e80f 100644 --- a/Src/PCompiler/CompilerCore/Compiler.cs +++ b/Src/PCompiler/CompilerCore/Compiler.cs @@ -53,9 +53,10 @@ public int Compile(ICompilerConfiguration job) IRTransformer.SimplifyMethod(fun); } + DirectoryInfo parentDirectory = job.OutputDirectory; foreach (var entry in job.OutputLanguages) { - job.OutputDirectory = Directory.CreateDirectory(Path.Combine(job.OutputDirectory.FullName, entry.Key)); + job.OutputDirectory = Directory.CreateDirectory(Path.Combine(parentDirectory.FullName, entry.Key)); job.Output = new DefaultCompilerOutput(job.OutputDirectory); job.Backend = TargetLanguage.GetCodeGenerator(entry.Value);