summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2019-08-31 22:51:59 +0800
committerruki <[email protected]>2019-08-31 22:51:59 +0800
commitf375773b28d671a8d4885ea09e64011106f077f9 (patch)
tree463821f1e28bc668252c052ebfd6ef711da3d695
parentd87ef11e59b4c84c13c680d0dd28bd9a93de39d9 (diff)
remove buildmodes
-rw-r--r--xmake/core/sandbox/modules/import/core/tool/compiler.lua10
-rw-r--r--xmake/core/tool/builder.lua10
-rw-r--r--xmake/languages/dlang/xmake.lua3
-rw-r--r--xmake/modules/core/tools/cl.lua6
-rw-r--r--xmake/modules/core/tools/cparser.lua6
-rw-r--r--xmake/modules/core/tools/dmd.lua6
-rw-r--r--xmake/modules/core/tools/fasm.lua6
-rw-r--r--xmake/modules/core/tools/gcc.lua6
-rw-r--r--xmake/modules/core/tools/go.lua6
-rw-r--r--xmake/modules/core/tools/llvm_rc.lua6
-rw-r--r--xmake/modules/core/tools/ml.lua6
-rw-r--r--xmake/modules/core/tools/nvcc.lua6
-rw-r--r--xmake/modules/core/tools/rc.lua6
-rw-r--r--xmake/modules/core/tools/rustc.lua9
-rw-r--r--xmake/modules/core/tools/swiftc.lua6
-rw-r--r--xmake/modules/core/tools/tcc.lua6
-rw-r--r--xmake/modules/core/tools/windres.lua6
-rw-r--r--xmake/modules/core/tools/yasm.lua6
-rw-r--r--xmake/rules/dlang/xmake.lua30
19 files changed, 33 insertions, 113 deletions
diff --git a/xmake/core/sandbox/modules/import/core/tool/compiler.lua b/xmake/core/sandbox/modules/import/core/tool/compiler.lua
index f93176181..0a312b813 100644
--- a/xmake/core/sandbox/modules/import/core/tool/compiler.lua
+++ b/xmake/core/sandbox/modules/import/core/tool/compiler.lua
@@ -43,16 +43,6 @@ function sandbox_core_tool_compiler.load(sourcekind, opt)
return instance
end
--- get the build mode of compiler
-function sandbox_core_tool_compiler.buildmode(sourcekind, name, opt)
-
- -- get the compiler instance
- local instance = sandbox_core_tool_compiler.load(sourcekind, opt)
-
- -- get build mode
- return instance:buildmode(name)
-end
-
-- make command for compiling source file
function sandbox_core_tool_compiler.compcmd(sourcefiles, objectfile, opt)
return os.args(table.join(sandbox_core_tool_compiler.compargv(sourcefiles, objectfile, opt)))
diff --git a/xmake/core/tool/builder.lua b/xmake/core/tool/builder.lua
index fc73a94fd..ba6f3bcf2 100644
--- a/xmake/core/tool/builder.lua
+++ b/xmake/core/tool/builder.lua
@@ -524,15 +524,5 @@ function builder:format(targetkind)
end
end
--- get buildmode of the tool
-function builder:buildmode(name)
-
- -- get it
- local buildmodes = self:get("buildmodes")
- if buildmodes then
- return buildmodes[name]
- end
-end
-
-- return module
return builder
diff --git a/xmake/languages/dlang/xmake.lua b/xmake/languages/dlang/xmake.lua
index de997afed..a651c52d9 100644
--- a/xmake/languages/dlang/xmake.lua
+++ b/xmake/languages/dlang/xmake.lua
@@ -39,6 +39,9 @@ language("dlang")
-- set mixing kinds
set_mixingkinds("dc", "cc", "cxx", "as")
+ -- add rules
+ add_rules("dlang")
+
-- on load
on_load("load")
diff --git a/xmake/modules/core/tools/cl.lua b/xmake/modules/core/tools/cl.lua
index 3fbae583b..c8e20d552 100644
--- a/xmake/modules/core/tools/cl.lua
+++ b/xmake/modules/core/tools/cl.lua
@@ -77,12 +77,6 @@ function init(self)
, ["-ftrapv"] = ""
, ["-fsanitize=address"] = ""
})
-
- -- init buildmodes
- self:set("buildmodes",
- {
- ["object:sources"] = false
- })
end
-- make the symbol flag
diff --git a/xmake/modules/core/tools/cparser.lua b/xmake/modules/core/tools/cparser.lua
index 5e34fdd63..a07f8e172 100644
--- a/xmake/modules/core/tools/cparser.lua
+++ b/xmake/modules/core/tools/cparser.lua
@@ -56,12 +56,6 @@ function init(self)
, ["-s"] = "-s"
, ["-S"] = "-S"
})
-
- -- init buildmodes
- self:set("buildmodes",
- {
- ["object:sources"] = false
- })
end
-- make the strip flag
diff --git a/xmake/modules/core/tools/dmd.lua b/xmake/modules/core/tools/dmd.lua
index 7c039319e..4ee8ecf9d 100644
--- a/xmake/modules/core/tools/dmd.lua
+++ b/xmake/modules/core/tools/dmd.lua
@@ -34,12 +34,6 @@ function init(self)
-- init dcflags for the kind: shared
self:set("shared.dcflags", "-fPIC")
-
- -- init buildmodes
- self:set("buildmodes",
- {
- ["object:sources"] = false
- })
end
-- make the optimize flag
diff --git a/xmake/modules/core/tools/fasm.lua b/xmake/modules/core/tools/fasm.lua
index 59aee4f55..ba34a8078 100644
--- a/xmake/modules/core/tools/fasm.lua
+++ b/xmake/modules/core/tools/fasm.lua
@@ -40,12 +40,6 @@ function init(self)
, ["-ftrapv"] = ""
, ["-fsanitize=address"] = ""
})
-
- -- init buildmodes
- self:set("buildmodes",
- {
- ["object:sources"] = false
- })
end
-- make the define flag
diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua
index 3574f869c..301f13ec3 100644
--- a/xmake/modules/core/tools/gcc.lua
+++ b/xmake/modules/core/tools/gcc.lua
@@ -69,12 +69,6 @@ function init(self)
, ["-S"] = "-Wl,-S"
})
end
-
- -- init buildmodes
- self:set("buildmodes",
- {
- ["object:sources"] = false
- })
end
-- make the strip flag
diff --git a/xmake/modules/core/tools/go.lua b/xmake/modules/core/tools/go.lua
index fa6541898..450240023 100644
--- a/xmake/modules/core/tools/go.lua
+++ b/xmake/modules/core/tools/go.lua
@@ -31,12 +31,6 @@ function init(self)
-- init the file formats
self:set("formats", { static = "$(name).a" })
-
- -- init buildmodes
- self:set("buildmodes",
- {
- ["object:sources"] = true
- })
end
-- make the optimize flag
diff --git a/xmake/modules/core/tools/llvm_rc.lua b/xmake/modules/core/tools/llvm_rc.lua
index ab072d507..75a1b2c8c 100644
--- a/xmake/modules/core/tools/llvm_rc.lua
+++ b/xmake/modules/core/tools/llvm_rc.lua
@@ -24,12 +24,6 @@ import("core.project.project")
-- init it
function init(self)
-
- -- init buildmodes
- self:set("buildmodes",
- {
- ["object:sources"] = false
- })
end
-- make the define flag
diff --git a/xmake/modules/core/tools/ml.lua b/xmake/modules/core/tools/ml.lua
index e14cc4e50..81d7c62d5 100644
--- a/xmake/modules/core/tools/ml.lua
+++ b/xmake/modules/core/tools/ml.lua
@@ -55,12 +55,6 @@ function init(self)
, ["-ftrapv"] = ""
, ["-fsanitize=address"] = ""
})
-
- -- init buildmodes
- self:set("buildmodes",
- {
- ["object:sources"] = false
- })
end
-- make the warning flag
diff --git a/xmake/modules/core/tools/nvcc.lua b/xmake/modules/core/tools/nvcc.lua
index 8c523cf2e..ab1920552 100644
--- a/xmake/modules/core/tools/nvcc.lua
+++ b/xmake/modules/core/tools/nvcc.lua
@@ -49,12 +49,6 @@ function init(self)
, ["-Wextra"] = "-Wreorder"
, ["-Weverything"] = "-Wreorder"
})
-
- -- init buildmodes
- self:set("buildmodes",
- {
- ["object:sources"] = false
- })
end
-- make the symbol flag
diff --git a/xmake/modules/core/tools/rc.lua b/xmake/modules/core/tools/rc.lua
index 2c72d0575..f5050f7f3 100644
--- a/xmake/modules/core/tools/rc.lua
+++ b/xmake/modules/core/tools/rc.lua
@@ -24,12 +24,6 @@ import("core.project.project")
-- init it
function init(self)
-
- -- init buildmodes
- self:set("buildmodes",
- {
- ["object:sources"] = false
- })
end
-- make the define flag
diff --git a/xmake/modules/core/tools/rustc.lua b/xmake/modules/core/tools/rustc.lua
index d3fbda362..730815158 100644
--- a/xmake/modules/core/tools/rustc.lua
+++ b/xmake/modules/core/tools/rustc.lua
@@ -37,15 +37,6 @@ function init(self)
-- init the file formats
self:set("formats", { static = "lib$(name).rlib" })
-
- -- init buildmodes
- self:set("buildmodes",
- {
- ["object:sources"] = false -- compile multiple source filess to the single object
- , ["binary:sources"] = true -- build multiple source files to the binary target file
- , ["static:sources"] = true -- build multiple source files to the static target file
- , ["shared:sources"] = true -- build multiple source files to the shared target file
- })
end
-- make the optimize flag
diff --git a/xmake/modules/core/tools/swiftc.lua b/xmake/modules/core/tools/swiftc.lua
index 2b7c16709..ca1c1abf0 100644
--- a/xmake/modules/core/tools/swiftc.lua
+++ b/xmake/modules/core/tools/swiftc.lua
@@ -55,12 +55,6 @@ function init(self)
, ["-ftrapv"] = ""
, ["-fsanitize=address"] = ""
})
-
- -- init buildmodes
- self:set("buildmodes",
- {
- ["object:sources"] = false
- })
end
-- make the strip flag
diff --git a/xmake/modules/core/tools/tcc.lua b/xmake/modules/core/tools/tcc.lua
index 1df92293c..d4fdbd60e 100644
--- a/xmake/modules/core/tools/tcc.lua
+++ b/xmake/modules/core/tools/tcc.lua
@@ -55,12 +55,6 @@ function init(self)
, ["-s"] = "-s"
, ["-S"] = "-S"
})
-
- -- init buildmodes
- self:set("buildmodes",
- {
- ["object:sources"] = false
- })
end
-- make the strip flag
diff --git a/xmake/modules/core/tools/windres.lua b/xmake/modules/core/tools/windres.lua
index c4e4290cd..8ca259538 100644
--- a/xmake/modules/core/tools/windres.lua
+++ b/xmake/modules/core/tools/windres.lua
@@ -24,12 +24,6 @@ import("core.project.project")
-- init it
function init(self)
-
- -- init buildmodes
- self:set("buildmodes",
- {
- ["object:sources"] = false
- })
end
-- make the define flag
diff --git a/xmake/modules/core/tools/yasm.lua b/xmake/modules/core/tools/yasm.lua
index d06026857..ce784e29a 100644
--- a/xmake/modules/core/tools/yasm.lua
+++ b/xmake/modules/core/tools/yasm.lua
@@ -43,12 +43,6 @@ function init(self)
, ["-ftrapv"] = ""
, ["-fsanitize=address"] = ""
})
-
- -- init buildmodes
- self:set("buildmodes",
- {
- ["object:sources"] = false
- })
end
-- make the warning flag
diff --git a/xmake/rules/dlang/xmake.lua b/xmake/rules/dlang/xmake.lua
new file mode 100644
index 000000000..318fd83c1
--- /dev/null
+++ b/xmake/rules/dlang/xmake.lua
@@ -0,0 +1,30 @@
+--!A cross-platform build utility based on Lua
+--
+-- Licensed under the Apache License, Version 2.0 (the "License");
+-- you may not use this file except in compliance with the License.
+-- You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+-- Copyright (C) 2015 - 2019, TBOOX Open Source Group.
+--
+-- @author ruki
+-- @file xmake.lua
+--
+
+-- define rule: dlang.build
+rule("dlang.build")
+ set_extensions(".d")
+ on_build_files(function (target, sourcefiles, opt)
+ import("private.action.build.object")(target, sourcefiles, opt)
+ end)
+
+-- define rule: dlang
+rule("dlang")
+ add_deps("dlang.build")