summaryrefslogtreecommitdiff
path: root/xmake/core/tool/compiler.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2017-02-07 09:01:16 +0800
committerruki <[email protected]>2017-02-07 09:01:16 +0800
commit072f97eb86fd3626fb70325e17e028bf90766dc2 (patch)
treec7b323a7bb3d9bc38ea2eba024eff2591d0dc6c7 /xmake/core/tool/compiler.lua
parent59c7e717b3e627fbfcee313f0c1d050e9bbceb5b (diff)
move some linker interfaces to builder
Diffstat (limited to 'xmake/core/tool/compiler.lua')
-rw-r--r--xmake/core/tool/compiler.lua55
1 files changed, 5 insertions, 50 deletions
diff --git a/xmake/core/tool/compiler.lua b/xmake/core/tool/compiler.lua
index 61cfd2114..cf175e622 100644
--- a/xmake/core/tool/compiler.lua
+++ b/xmake/core/tool/compiler.lua
@@ -46,63 +46,18 @@ function compiler:_language()
return self._LANGUAGE
end
--- get the source flags
-function compiler:_sourceflags()
-
- -- get it
- return self._SOURCEFLAGS
-end
-
--- add flags from the configure
-function compiler:_addflags_from_config(flags)
-
- -- done
- for _, sourceflag in ipairs(self:_sourceflags()) do
- table.join2(flags, config.get(sourceflag))
- end
-end
-
--- add flags from the target
-function compiler:_addflags_from_target(flags, target)
-
- -- add the target flags
- for _, sourceflag in ipairs(self:_sourceflags()) do
- table.join2(flags, self:_mapflags(target:get(sourceflag)))
- end
-
- -- for target options?
- if target.options then
-
- -- add the flags for the target options
- for _, opt in ipairs(target:options()) do
-
- -- add the flags from the option
- self:_addflags_from_target(flags, opt)
- end
- end
-end
-
--- add flags from the platform
-function compiler:_addflags_from_platform(flags)
-
- -- add flags
- for _, sourceflag in ipairs(self:_sourceflags()) do
- table.join2(flags, platform.get(sourceflag))
- end
-end
-
-- add flags from the compiler
function compiler:_addflags_from_compiler(flags, kind)
-- done
- for _, sourceflag in ipairs(self:_sourceflags()) do
+ for _, flagkind in ipairs(self:_flagkinds()) do
-- add compiler.xxflags
- table.join2(flags, self:get(sourceflag))
+ table.join2(flags, self:get(flagkind))
-- add compiler.kind.xxflags
if kind ~= nil and self:get(kind) ~= nil then
- table.join2(flags, self:get(kind)[sourceflag])
+ table.join2(flags, self:get(kind)[flagkind])
end
end
end
@@ -139,8 +94,8 @@ function compiler.load(sourcekind)
-- init name flags
instance._NAMEFLAGS = result:nameflags()["compiler"]
- -- init source flags
- instance._SOURCEFLAGS = table.wrap(result:sourceflags()[sourcekind])
+ -- init flag kinds
+ instance._FLAGKINDS = table.wrap(result:sourceflags()[sourcekind])
-- save this instance
compiler._INSTANCES[sourcekind] = instance