summaryrefslogtreecommitdiff
path: root/xmake/scripts/compiler/compiler.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/scripts/compiler/compiler.lua')
-rw-r--r--xmake/scripts/compiler/compiler.lua46
1 files changed, 15 insertions, 31 deletions
diff --git a/xmake/scripts/compiler/compiler.lua b/xmake/scripts/compiler/compiler.lua
index 2be9eaf45..9a6192b26 100644
--- a/xmake/scripts/compiler/compiler.lua
+++ b/xmake/scripts/compiler/compiler.lua
@@ -28,34 +28,6 @@ local utils = require("base/utils")
local string = require("base/string")
local config = require("base/config")
--- get the configure from the given name
-function compiler._get(self, name)
-
- -- check
- assert(self and name);
-
- -- the compiler configure
- local configs = self._CONFIGS
- assert(configs)
-
- -- get it
- return configs[name]
-end
-
--- make the compile command
-function compiler._make(self, srcfile, objfile, flags)
-
- -- check
- assert(self);
-
- -- the configure
- local configs = self._CONFIGS
- assert(configs)
-
- -- get it
- return self._make(configs, srcfile, objfile, flags)
-end
-
-- map gcc flags to the given compiler flags
function compiler._mapflags(self, flags)
@@ -85,6 +57,20 @@ function compiler._mapflags(self, flags)
return flag_mapped
end
+-- make the compile command
+function compiler._make(self, srcfile, objfile, flags)
+
+ -- check
+ assert(self);
+
+ -- the configure
+ local configs = self._CONFIGS
+ assert(configs)
+
+ -- get it
+ return self._make(configs, srcfile, objfile, compiler._mapflags(self, flags))
+end
+
-- load the given compiler
function compiler.load(name)
@@ -129,9 +115,7 @@ function compiler.load(name)
c._init(configs)
-- init interfaces
- c["get"] = compiler._get
- c["make"] = compiler._make
- c["mapflags"] = compiler._mapflags
+ c["make"] = compiler._make
-- ok?
return c