diff options
| author | ruki <[email protected]> | 2017-02-07 09:01:16 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-02-07 09:01:16 +0800 |
| commit | 072f97eb86fd3626fb70325e17e028bf90766dc2 (patch) | |
| tree | c7b323a7bb3d9bc38ea2eba024eff2591d0dc6c7 /xmake/core/tool/builder.lua | |
| parent | 59c7e717b3e627fbfcee313f0c1d050e9bbceb5b (diff) | |
move some linker interfaces to builder
Diffstat (limited to 'xmake/core/tool/builder.lua')
| -rw-r--r-- | xmake/core/tool/builder.lua | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/xmake/core/tool/builder.lua b/xmake/core/tool/builder.lua index c529d2327..c0a75dac8 100644 --- a/xmake/core/tool/builder.lua +++ b/xmake/core/tool/builder.lua @@ -109,6 +109,51 @@ function builder:_mapflags(flags) return results end +-- get the flag kinds +function builder:_flagkinds() + + -- get it + return self._FLAGKINDS +end + +-- add flags from the configure +function builder:_addflags_from_config(flags) + + -- done + for _, flagkind in ipairs(self:_flagkinds()) do + table.join2(flags, config.get(flagkind)) + end +end + +-- add flags from the target +function builder:_addflags_from_target(flags, target) + + -- add the target flags + for _, flagkind in ipairs(self:_flagkinds()) do + table.join2(flags, self:_mapflags(target:get(flagkind))) + 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 builder:_addflags_from_platform(flags) + + -- add flags + for _, flagkind in ipairs(self:_flagkinds()) do + table.join2(flags, platform.get(flagkind)) + end +end + -- add flags (named) from the language function builder:_addflags_from_language(flags, target) |
