summaryrefslogtreecommitdiff
path: root/xmake/scripts/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/scripts/compiler')
-rw-r--r--xmake/scripts/compiler/_clang.lua7
-rw-r--r--xmake/scripts/compiler/compiler.lua17
2 files changed, 23 insertions, 1 deletions
diff --git a/xmake/scripts/compiler/_clang.lua b/xmake/scripts/compiler/_clang.lua
index 27f9b868f..6bfa83d69 100644
--- a/xmake/scripts/compiler/_clang.lua
+++ b/xmake/scripts/compiler/_clang.lua
@@ -33,6 +33,13 @@ function _clang._init(configs)
end
+-- make the compiler command
+function _clang._make(configs, srcfile, objfile, flags)
+
+ -- make it
+ return string.format("%s -c %s -o%s %s", configs.name, flags, objfile, srcfile)
+end
+
-- map gcc flag to the current compiler flag
function _clang._mapflag(configs, flag)
diff --git a/xmake/scripts/compiler/compiler.lua b/xmake/scripts/compiler/compiler.lua
index bc84c177f..2be9eaf45 100644
--- a/xmake/scripts/compiler/compiler.lua
+++ b/xmake/scripts/compiler/compiler.lua
@@ -42,6 +42,20 @@ function compiler._get(self, name)
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)
@@ -68,7 +82,7 @@ function compiler._mapflags(self, flags)
end
-- ok?
- return flag_mapped;
+ return flag_mapped
end
-- load the given compiler
@@ -116,6 +130,7 @@ function compiler.load(name)
-- init interfaces
c["get"] = compiler._get
+ c["make"] = compiler._make
c["mapflags"] = compiler._mapflags
-- ok?