summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2023-01-29 11:03:46 +0800
committerruki <[email protected]>2023-01-29 11:03:46 +0800
commit5a9df973279a63b94c220e6d21a7c3294bcff59f (patch)
tree108ef54b2bb9df818371de02939560fca6bb9ed6
parent1e30c32a5c6a5355ba8784e91da13158a91c8487 (diff)
improve strip for dmd/ldc
-rw-r--r--xmake/modules/core/tools/dmd.lua19
-rw-r--r--xmake/modules/core/tools/ldc2.lua25
2 files changed, 21 insertions, 23 deletions
diff --git a/xmake/modules/core/tools/dmd.lua b/xmake/modules/core/tools/dmd.lua
index 899fc2511..a68542be2 100644
--- a/xmake/modules/core/tools/dmd.lua
+++ b/xmake/modules/core/tools/dmd.lua
@@ -48,21 +48,10 @@ function nf_optimize(self, level)
local maps =
{
fast = "-O"
- , faster = "-O -release"
- , fastest = "-O -release -inline -boundscheck=off"
- , smallest = "-O -release -boundscheck=off"
- , aggressive = "-O -release -inline -boundscheck=off"
- }
- return maps[level]
- end
-end
-
--- make the strip flag
-function nf_strip(self, level)
- if not self:is_plat("windows") then
- local maps = {
- debug = "-L-S",
- all = "-L-s"
+ , faster = {"-O", "-release"}
+ , fastest = {"-O", "-release", "-inline", "-boundscheck=off"}
+ , smallest = {"-O", "-release", "-boundscheck=off"}
+ , aggressive = {"-O", "-release", "-inline", "-boundscheck=off"}
}
return maps[level]
end
diff --git a/xmake/modules/core/tools/ldc2.lua b/xmake/modules/core/tools/ldc2.lua
index d62c45a53..2562ef07e 100644
--- a/xmake/modules/core/tools/ldc2.lua
+++ b/xmake/modules/core/tools/ldc2.lua
@@ -36,21 +36,30 @@ end
-- make the optimize flag
function nf_optimize(self, level)
- local maps =
- {
+ local maps = {
fast = "-O"
- , faster = "-O --release"
- , fastest = "-O --release --boundscheck=off"
- , smallest = "-O --release --boundscheck=off"
- , aggressive = "-O --release --boundscheck=off"
+ , faster = {"-O", "--release"}
+ , fastest = {"-O", "--release", "--boundscheck=off"}
+ , smallest = {"-O", "--release", "--boundscheck=off"}
+ , aggressive = {"-O", "--release", "--boundscheck=off"}
}
return maps[level]
end
+-- make the strip flag
+function nf_strip(self, level)
+ if not self:is_plat("windows") then
+ local maps = {
+ debug = "-L-S",
+ all = "-L-s"
+ }
+ return maps[level]
+ end
+end
+
-- make the symbol flag
function nf_symbol(self, level)
- local maps =
- {
+ local maps = {
debug = "-g --d-debug"
}
return maps[level]