diff options
| author | ruki <[email protected]> | 2017-06-26 22:26:33 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-06-26 22:26:33 +0800 |
| commit | 08423656d08715670959b69c64957e9e9b1b3db1 (patch) | |
| tree | 8739a1ef0ed686ab83239910681b70c0dea858ad /xmake/plugins/project | |
| parent | f57db3954d227c29d15b68316e9b18838a55c3d4 (diff) | |
modify compiler and linker args
Diffstat (limited to 'xmake/plugins/project')
| -rw-r--r-- | xmake/plugins/project/makefile/makefile.lua | 10 | ||||
| -rw-r--r-- | xmake/plugins/project/vstudio/impl/vs200x_vcproj.lua | 4 | ||||
| -rw-r--r-- | xmake/plugins/project/vstudio/impl/vs201x.lua | 4 |
3 files changed, 9 insertions, 9 deletions
diff --git a/xmake/plugins/project/makefile/makefile.lua b/xmake/plugins/project/makefile/makefile.lua index dadaaba1c..2efe09cea 100644 --- a/xmake/plugins/project/makefile/makefile.lua +++ b/xmake/plugins/project/makefile/makefile.lua @@ -103,10 +103,10 @@ function _make_object(makefile, target, sourcefile, objectfile) local program = platform.tool(sourcekind) -- get complier flags - local compflags = compiler.compflags(sourcefile, target, sourcekind) + local compflags = compiler.compflags(sourcefile, {target = target, sourcekind = sourcekind}) -- make command - local command = compiler.compcmd(sourcefile, objectfile, target) + local command = compiler.compcmd(sourcefile, objectfile, {target = target}) -- replace compflags to $(XX) local p, e = command:find(compflags, 1, true) @@ -164,10 +164,10 @@ function _make_single_object(makefile, target, sourcekind, sourcebatch) local program = platform.tool(sourcekind) -- get complier flags - local compflags = compiler.compflags(sourcefiles, target, sourcekind) + local compflags = compiler.compflags(sourcefiles, {target = target, sourcekind = sourcekind}) -- make command - local command = compiler.compcmd(sourcefiles, objectfiles, target, sourcekind) + local command = compiler.compcmd(sourcefiles, objectfiles, {target = target, sourcekind = sourcekind}) -- replace compflags to $(XX) local p, e = command:find(compflags, 1, true) @@ -346,7 +346,7 @@ function _make_all(makefile) for targetname, target in pairs(project.targets()) do if not target:isphony() then for sourcekind, sourcebatch in pairs(target:sourcebatches()) do - makefile:print("%s_%s=%s", targetname, sourcekind:upper(), compiler.compflags(sourcebatch.sourcefiles, target, sourcekind)) + 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()) end diff --git a/xmake/plugins/project/vstudio/impl/vs200x_vcproj.lua b/xmake/plugins/project/vstudio/impl/vs200x_vcproj.lua index 094b7a166..f937c5efb 100644 --- a/xmake/plugins/project/vstudio/impl/vs200x_vcproj.lua +++ b/xmake/plugins/project/vstudio/impl/vs200x_vcproj.lua @@ -32,7 +32,7 @@ import("vsfile") function _make_compflags(sourcefile, target, vcprojdir) -- make the compiling flags - local _, compflags = compiler.compflags(sourcefile, target) + local _, compflags = compiler.compflags(sourcefile, {target = target}) -- replace -Idir or /Idir, -Fdsymbol.pdb or /Fdsymbol.pdb local flags = {} @@ -74,7 +74,7 @@ end function _make_linkflags(target, vcprojdir) -- make the linking flags - local _, linkflags = linker.linkflags(target) + local _, linkflags = linker.linkflags(target:get("kind"), target:sourcekinds()) -- replace -libpath:dir or /libpath:dir, -pdb:symbol.pdb or /pdb:symbol.pdb local flags = {} diff --git a/xmake/plugins/project/vstudio/impl/vs201x.lua b/xmake/plugins/project/vstudio/impl/vs201x.lua index 29b004030..a134bbb90 100644 --- a/xmake/plugins/project/vstudio/impl/vs201x.lua +++ b/xmake/plugins/project/vstudio/impl/vs201x.lua @@ -51,12 +51,12 @@ function _make_targetinfo(mode, arch, target) -- save compiler flags targetinfo.compflags = {} for _, sourcefile in ipairs(target:sourcefiles()) do - local _, compflags = compiler.compflags(sourcefile, target) + local _, compflags = compiler.compflags(sourcefile, {target = target}) targetinfo.compflags[sourcefile] = compflags end -- save linker flags - local _, linkflags = linker.linkflags(target) + local _, linkflags = linker.linkflags(target:get("kinds"), target:sourcekinds()) targetinfo.linkflags = linkflags -- ok |
