mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-06 11:54:11 +00:00
record cppdefine for incremental compilation
This commit is contained in:
@@ -245,9 +245,6 @@ template depConfigFields*(fn) {.dirty.} =
|
||||
fn(globalOptions)
|
||||
fn(selectedGC)
|
||||
|
||||
template serializeConfigFields(fn) {.dirty.} =
|
||||
fn(cppDefines) # XXX TODO: Replay this.
|
||||
|
||||
const oldExperimentalFeatures* = {implicitDeref, dotOperators, callOperator, parallel}
|
||||
|
||||
const
|
||||
|
||||
@@ -748,10 +748,12 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: var int,
|
||||
of wImportc:
|
||||
let name = getOptionalStr(c, it, "$1")
|
||||
cppDefine(c.config, name)
|
||||
recordPragma(c, it, "cppdefine", name)
|
||||
makeExternImport(c, sym, name, it.info)
|
||||
of wImportCompilerProc:
|
||||
let name = getOptionalStr(c, it, "$1")
|
||||
cppDefine(c.config, name)
|
||||
recordPragma(c, it, "cppdefine", name)
|
||||
processImportCompilerProc(c, sym, name, it.info)
|
||||
of wExtern: setExternName(c, sym, expectStrLit(c, it), it.info)
|
||||
of wImmediate:
|
||||
@@ -844,6 +846,7 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: var int,
|
||||
of wCompilerProc, wCore:
|
||||
noVal(c, it) # compilerproc may not get a string!
|
||||
cppDefine(c.graph.config, sym.name.s)
|
||||
recordPragma(c, it, "cppdefine", sym.name.s)
|
||||
if sfFromGeneric notin sym.flags: markCompilerProc(c, sym)
|
||||
of wProcVar:
|
||||
noVal(c, it)
|
||||
|
||||
@@ -793,6 +793,8 @@ proc replay(g: ModuleGraph; module: PSym; n: PNode) =
|
||||
extccomp.addLinkOption(g.config, n[1].strVal)
|
||||
of "passc":
|
||||
extccomp.addCompileOption(g.config, n[1].strVal)
|
||||
of "cppdefine":
|
||||
options.cppDefine(g.config, n[1].strVal)
|
||||
of "inc":
|
||||
let destKey = n[1].strVal
|
||||
let by = n[2].intVal
|
||||
|
||||
Reference in New Issue
Block a user