From 54a85b4ff56393e7279f244fe8557ebb36f864ee Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Fri, 13 Jul 2018 15:23:41 +0200 Subject: [PATCH] Give different names to objects coming from cpp files (#8278) Prevent some nasty linker errors if the user switches between c and cpp backends. --- compiler/extccomp.nim | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/compiler/extccomp.nim b/compiler/extccomp.nim index a48067abb7..575e30a794 100644 --- a/compiler/extccomp.nim +++ b/compiler/extccomp.nim @@ -434,10 +434,7 @@ proc completeCFilePath*(conf: ConfigRef; cfile: string, createSubDir: bool = tru proc toObjFile*(conf: ConfigRef; filename: string): string = # Object file for compilation - #if filename.endsWith(".cpp"): - # result = changeFileExt(filename, "cpp." & CC[cCompiler].objExt) - #else: - result = changeFileExt(filename, CC[conf.cCompiler].objExt) + result = filename & "." & CC[conf.cCompiler].objExt proc addFileToCompile*(conf: ConfigRef; cf: Cfile) = conf.toCompile.add(cf)