diff options
| author | SirLynix <[email protected]> | 2022-08-05 18:34:44 +0200 |
|---|---|---|
| committer | SirLynix <[email protected]> | 2022-08-05 18:34:44 +0200 |
| commit | caf2e66bcecf3370472bcb9dca266ae5037f7284 (patch) | |
| tree | 2a8aa82fd9bdf417783db848dc44813f13a088ae /xmake/modules/core/tools/emcc.lua | |
| parent | 67a3575689b9761677b48bfb4588712f117924fb (diff) | |
emcc: Handle -gsource-map (close #2646)
Diffstat (limited to 'xmake/modules/core/tools/emcc.lua')
| -rw-r--r-- | xmake/modules/core/tools/emcc.lua | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/xmake/modules/core/tools/emcc.lua b/xmake/modules/core/tools/emcc.lua index 8c08e4b0d..18fc32848 100644 --- a/xmake/modules/core/tools/emcc.lua +++ b/xmake/modules/core/tools/emcc.lua @@ -45,6 +45,19 @@ end function nf_rpathdir(self, dir) end +-- make the symbol flag +function nf_symbol(self, level) + local kind = self:kind() + if kind == "ld" or kind == "sh" then + -- emscripten requires -gsource-map when linking to map JS/wasm code back to original source + if level == "debug" then + return "-gsource-map" + end + end + + return _super.nf_symbol(self, level) +end + -- make the link arguments list function linkargv(self, objectfiles, targetkind, targetfile, flags, opt) |
