diff options
-rw-r--r-- | compiler/options.nim | 3 | ||||
-rw-r--r-- | compiler/pragmas.nim | 3 | ||||
-rw-r--r-- | compiler/rodimpl.nim | 2 |
3 files changed, 5 insertions, 3 deletions
diff --git a/compiler/options.nim b/compiler/options.nim index d3f2f9d1c..74a217fbc 100644 --- a/compiler/options.nim +++ b/compiler/options.nim @@ -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 diff --git a/compiler/pragmas.nim b/compiler/pragmas.nim index a51d250a2..bfb06e00a 100644 --- a/compiler/pragmas.nim +++ b/compiler/pragmas.nim @@ -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) diff --git a/compiler/rodimpl.nim b/compiler/rodimpl.nim index 8cac5d030..955e881e2 100644 --- a/compiler/rodimpl.nim +++ b/compiler/rodimpl.nim @@ -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 |