diff options
| author | ruki <[email protected]> | 2023-01-11 22:34:45 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-01-11 22:34:45 +0800 |
| commit | b2d7833b6a7637828473868aa331ef6810163562 (patch) | |
| tree | 25452cc6e92f089be23e868317961a60263d56d4 /xmake/modules/core/tools/nim.lua | |
| parent | a4e7ecaa3920b2fd4928ed95f5f97361be45c354 (diff) | |
fix nim #3273
Diffstat (limited to 'xmake/modules/core/tools/nim.lua')
| -rw-r--r-- | xmake/modules/core/tools/nim.lua | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/xmake/modules/core/tools/nim.lua b/xmake/modules/core/tools/nim.lua index bf6e48d19..b3ee05767 100644 --- a/xmake/modules/core/tools/nim.lua +++ b/xmake/modules/core/tools/nim.lua @@ -123,17 +123,11 @@ end -- make the build arguments list function buildargv(self, sourcefiles, targetkind, targetfile, flags) local flags_extra = {} - if targetkind == "static" then - -- fix multiple definition of `NimMain', it is only workaround solution - -- we need to wait for this problem to be resolved + if targetkind == "binary" then + -- fix multiple definition of `NimMain' -- - -- @see https://github.com/nim-lang/Nim/issues/15955 - local uniquekey = hash.uuid(targetfile):split("-", {plain = true})[1] - table.insert(flags_extra, "--passC:-DNimMain=NimMain_" .. uniquekey) - table.insert(flags_extra, "--passC:-DNimMainInner=NimMainInner_" .. uniquekey) - table.insert(flags_extra, "--passC:-DNimMainModule=NimMainModule_" .. uniquekey) - table.insert(flags_extra, "--passC:-DPreMain=PreMain_" .. uniquekey) - table.insert(flags_extra, "--passC:-DPreMainInner=PreMainInner_" .. uniquekey) + -- @see https://github.com/nim-lang/Nim/issues/19830 + table.insert(flags_extra, "--passL:-Wl,--allow-multiple-definition") end if targetkind ~= "static" and self:is_plat("windows") then -- fix link flags for windows |
