diff options
| author | ruki <[email protected]> | 2017-06-29 20:03:38 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-06-29 20:03:38 +0800 |
| commit | 0f9ddb186bff17c0c430118860503532b72c5cce (patch) | |
| tree | 5984b9a7c5b82d9a2728d5f90a25127a6fc728b0 | |
| parent | cffdbf25772f185bdd86bb08705d0ddfe288bfb9 (diff) | |
fix some makefile bug
| -rw-r--r-- | xmake/core/language/language.lua | 8 | ||||
| -rw-r--r-- | xmake/core/sandbox/modules/import/core/platform/platform.lua | 10 | ||||
| -rw-r--r-- | xmake/plugins/project/makefile/makefile.lua | 4 | ||||
| -rw-r--r-- | xmake/plugins/project/vstudio/impl/vs201x.lua | 2 |
4 files changed, 12 insertions, 12 deletions
diff --git a/xmake/core/language/language.lua b/xmake/core/language/language.lua index e76d10b10..dbe66b6b8 100644 --- a/xmake/core/language/language.lua +++ b/xmake/core/language/language.lua @@ -115,15 +115,11 @@ end -- get the source kinds function _instance:sourcekinds() - - -- get it return self._INFO.sourcekinds end -- get the source flags function _instance:sourceflags() - - -- get it return self._INFO.sourceflags end @@ -133,8 +129,6 @@ end -- {binary = "ld", static = "ar", shared = "sh"} -- function _instance:targetkinds() - - -- get it return self._INFO.targetkinds end @@ -654,7 +648,7 @@ function language.targetkinds() -- merge all for each language local targetkinds = {} for name, instance in pairs(languages) do - for targetkind, linkerkind in pairs(instance:targetkinds()) do + for targetkind, linkerkind in pairs(table.wrap(instance:targetkinds())) do targetkinds[targetkind] = targetkinds[targetkind] or {} table.insert(targetkinds[targetkind], linkerkind) end diff --git a/xmake/core/sandbox/modules/import/core/platform/platform.lua b/xmake/core/sandbox/modules/import/core/platform/platform.lua index 2dee562f1..e4175aaaa 100644 --- a/xmake/core/sandbox/modules/import/core/platform/platform.lua +++ b/xmake/core/sandbox/modules/import/core/platform/platform.lua @@ -63,10 +63,16 @@ end -- get the current platform configure function sandbox_core_platform.get(name, plat) - - -- get the given platform configure return platform.get(name, plat) end +-- get the platform tool from the kind +-- +-- .e.g cc, cxx, mm, mxx, as, ar, ld, sh, .. +-- +function sandbox_core_platform.tool(toolkind) + return platform.tool(toolkind) +end + -- return module return sandbox_core_platform diff --git a/xmake/plugins/project/makefile/makefile.lua b/xmake/plugins/project/makefile/makefile.lua index 2efe09cea..e09b4edc1 100644 --- a/xmake/plugins/project/makefile/makefile.lua +++ b/xmake/plugins/project/makefile/makefile.lua @@ -248,7 +248,7 @@ function _make_target(makefile, target) makefile:print("") -- get linker kind - local linkerkind = target:linker():get("kind") + local linkerkind = target:linker():kind() -- get program local program = platform.tool(linkerkind) @@ -348,7 +348,7 @@ function _make_all(makefile) for sourcekind, sourcebatch in pairs(target:sourcebatches()) do makefile:print("%s_%s=%s", targetname, sourcekind:upper(), compiler.compflags(sourcebatch.sourcefiles, {target = target, sourcekind = sourcekind})) end - makefile:print("%s_%s=%s", targetname, target:linker():get("kind"):upper(), target:linkflags()) + makefile:print("%s_%s=%s", targetname, target:linker():kind():upper(), target:linkflags()) end end makefile:print("") diff --git a/xmake/plugins/project/vstudio/impl/vs201x.lua b/xmake/plugins/project/vstudio/impl/vs201x.lua index a134bbb90..e3aed1b88 100644 --- a/xmake/plugins/project/vstudio/impl/vs201x.lua +++ b/xmake/plugins/project/vstudio/impl/vs201x.lua @@ -56,7 +56,7 @@ function _make_targetinfo(mode, arch, target) end -- save linker flags - local _, linkflags = linker.linkflags(target:get("kinds"), target:sourcekinds()) + local _, linkflags = linker.linkflags(target:get("kind"), target:sourcekinds()) targetinfo.linkflags = linkflags -- ok |
