fixes #22321; fixes building DLL with --noMain still produces a DllMain (#22323)

* fixes #22321; Building DLL with --noMain produces an unexpected DllMain on devel branch

* remove implicit nomain
This commit is contained in:
ringabout
2023-07-24 23:22:50 +08:00
committed by GitHub
parent 49a108b302
commit 8216d7dd46
2 changed files with 1 additions and 2 deletions

View File

@@ -1636,7 +1636,7 @@ proc genMainProc(m: BModule) =
appcg(m, m.s[cfsProcs], nimMain,
[m.g.mainModInit, initStackBottomCall, m.labels, preMainCode, m.config.nimMainPrefix, isVolatile])
if optNoMain notin m.config.globalOptions or optGenDynLib in m.config.globalOptions:
if optNoMain notin m.config.globalOptions:
if m.config.cppCustomNamespace.len > 0:
closeNamespaceNim(m.s[cfsProcs])
m.s[cfsProcs].add "using namespace " & m.config.cppCustomNamespace & ";\L"

View File

@@ -802,7 +802,6 @@ proc processSwitch*(switch, arg: string, pass: TCmdLinePass, info: TLineInfo;
defineSymbol(conf.symbols, "consoleapp")
of "lib":
incl(conf.globalOptions, optGenDynLib)
incl(conf.globalOptions, optNoMain)
excl(conf.globalOptions, optGenGuiApp)
defineSymbol(conf.symbols, "library")
defineSymbol(conf.symbols, "dll")