diff options
| author | ruki <[email protected]> | 2024-08-30 22:49:47 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-08-30 22:49:47 +0800 |
| commit | 456eedcebb5adac9063d9417f68a47ebe0cddb49 (patch) | |
| tree | 2578e3f3262e46c854497c2e861bd8d29d831c67 /xmake/core/package/package.lua | |
| parent | d1b64e63ff0e39badc4bd03b65033149af66c5f8 (diff) | |
fix map runtime flags
Diffstat (limited to 'xmake/core/package/package.lua')
| -rw-r--r-- | xmake/core/package/package.lua | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua index a833a2f0b..22a8dfb2b 100644 --- a/xmake/core/package/package.lua +++ b/xmake/core/package/package.lua @@ -2372,17 +2372,18 @@ function _instance:_generate_build_configs(configs, opt) end if runtimes then local sourcekind = opt.sourcekind or "cxx" - local linker = self:linker("binary", sourcekind) - local fake_target = {is_shared = function(_) return false end, - sourcekinds = function(_) return sourcekind end} local compiler = self:compiler(sourcekind) - local cxflags = compiler:map_flags("runtime", runtimes, {target = fake_target}) + local cxflags = compiler:map_flags("runtime", runtimes, {target = self}) configs.cxflags = table.wrap(configs.cxflags) table.join2(configs.cxflags, cxflags) - local ldflags = linker:map_flags("runtime", runtimes, {target = fake_target}) + local ldflags = self:linker("binary", sourcekind):map_flags("runtime", runtimes, {target = self}) configs.ldflags = table.wrap(configs.ldflags) table.join2(configs.ldflags, ldflags) + + local shflags = self:linker("shared", sourcekind):map_flags("runtime", runtimes, {target = self}) + configs.shflags = table.wrap(configs.shflags) + table.join2(configs.shflags, shflags) end if self:config("lto") then local configs_lto = self:_generate_lto_configs(opt.sourcekind or "cxx") |
