Skip to content

Commit 5010bc1

Browse files
timotheecourAraq
authored andcommitted
fixes #13144 (#13145)
* fixup: genscript now does not copy nimbase.h but uses -I$nim/lib
1 parent c56612f commit 5010bc1

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

compiler/extccomp.nim

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -501,10 +501,7 @@ proc generateScript(conf: ConfigRef; script: Rope) =
501501
let (_, name, _) = splitFile(conf.outFile.string)
502502
let filename = getNimcacheDir(conf) / RelativeFile(addFileExt("compile_" & name,
503503
platform.OS[conf.target.targetOS].scriptExt))
504-
if writeRope(script, filename):
505-
copyFile(conf.libpath / RelativeFile"nimbase.h",
506-
getNimcacheDir(conf) / RelativeFile"nimbase.h")
507-
else:
504+
if not writeRope(script, filename):
508505
rawMessage(conf, errGenerated, "could not write to file: " & filename.string)
509506

510507
proc getOptSpeed(conf: ConfigRef; c: TSystemCC): string =
@@ -607,17 +604,15 @@ proc getCompileCFileCmd*(conf: ConfigRef; cfile: Cfile,
607604
ospNeedsPIC in platform.OS[conf.target.targetOS].props:
608605
options.add(' ' & CC[c].pic)
609606

610-
var includeCmd, compilePattern: string
607+
var compilePattern: string
608+
# compute include paths:
609+
var includeCmd = CC[c].includeCmd & quoteShell(conf.libpath)
611610
if not noAbsolutePaths(conf):
612-
# compute include paths:
613-
includeCmd = CC[c].includeCmd & quoteShell(conf.libpath)
614-
615611
for includeDir in items(conf.cIncludes):
616612
includeCmd.add(join([CC[c].includeCmd, includeDir.quoteShell]))
617613

618614
compilePattern = joinPath(conf.cCompilerPath, exe)
619615
else:
620-
includeCmd = ""
621616
compilePattern = getCompilerExe(conf, c, cfile.cname)
622617

623618
includeCmd.add(join([CC[c].includeCmd, quoteShell(conf.projectPath.string)]))

0 commit comments

Comments
 (0)