From 8178388a78a013c990e2a7a8e97e4595449e5944 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Sat, 5 Dec 2020 00:36:06 +0100 Subject: [PATCH] fixes #16249 [backport:1.4] (#16251) --- compiler/cgen.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/cgen.nim b/compiler/cgen.nim index a3d3425e31..c4544bbc56 100644 --- a/compiler/cgen.nim +++ b/compiler/cgen.nim @@ -2044,7 +2044,7 @@ proc myClose(graph: ModuleGraph; b: PPassContext, n: PNode): PNode = if m.config.exc == excGoto and getCompilerProc(graph, "nimTestErrorFlag") != nil: discard cgsym(m, "nimTestErrorFlag") - if {optGenStaticLib, optGenDynLib} * m.config.globalOptions == {}: + if {optGenStaticLib, optGenDynLib, optNoMain} * m.config.globalOptions == {}: for i in countdown(high(graph.globalDestructors), 0): n.add graph.globalDestructors[i] if passes.skipCodegen(m.config, n): return