diff options
| author | OpportunityLiu <[email protected]> | 2019-07-18 19:50:02 +0800 |
|---|---|---|
| committer | OpportunityLiu <[email protected]> | 2019-07-19 11:48:33 +0800 |
| commit | e765aa75b91f847e93893271abe1cf265126da54 (patch) | |
| tree | b30511a741672d712d43fb419499fcf30e80de37 /xmake/plugins | |
| parent | a8cc8e8989fd52574088200c5d6bbc3a4582d911 (diff) | |
cleanup code
Diffstat (limited to 'xmake/plugins')
| -rwxr-xr-x | xmake/plugins/project/main.lua | 33 | ||||
| -rw-r--r-- | xmake/plugins/project/vstudio/vs.lua | 17 | ||||
| -rw-r--r-- | xmake/plugins/project/vstudio/vsx.lua | 35 | ||||
| -rw-r--r-- | xmake/plugins/project/vsxmake/vsxmake.lua | 5 |
4 files changed, 27 insertions, 63 deletions
diff --git a/xmake/plugins/project/main.lua b/xmake/plugins/project/main.lua index ede6989fb..cfcf10c2b 100755 --- a/xmake/plugins/project/main.lua +++ b/xmake/plugins/project/main.lua @@ -26,27 +26,10 @@ import("core.platform.environment") import("make.makefile") import("cmake.cmakelists") import("vstudio.vs") -import("vstudio.vsx") import("vsxmake.vsxmake") import("clang.compile_flags") import("clang.compile_commands") -function _vs(outputdir) - local vsver = assert(tonumber(config.get("vs")), "invalid vs version, run `xmake f --vs=2015`") - vprint("using project kind vs%d", vsver) - if vsver < 2010 then - return vs.make(vsver)(outputdir) - else - return vsx.make(vsver)(outputdir) - end -end - -function _vsxmake(outputdir) - local vsver = assert(tonumber(config.get("vs")), "invalid vs version, run `xmake f --vs=2015`") - vprint("using project kind vsxmake%d", vsver) - return vsxmake.make(vsver)(outputdir) -end - -- make project function _make(kind) @@ -59,20 +42,20 @@ function _make(kind) , vs2003 = vs.make(2003) , vs2005 = vs.make(2005) , vs2008 = vs.make(2008) - , vs2010 = vsx.make(2010) - , vs2012 = vsx.make(2012) - , vs2013 = vsx.make(2013) - , vs2015 = vsx.make(2015) - , vs2017 = vsx.make(2017) - , vs2019 = vsx.make(2019) - , vs = _vs + , vs2010 = vs.make(2010) + , vs2012 = vs.make(2012) + , vs2013 = vs.make(2013) + , vs2015 = vs.make(2015) + , vs2017 = vs.make(2017) + , vs2019 = vs.make(2019) + , vs = vs.make() , vsxmake2010 = vsxmake.make(2010) , vsxmake2012 = vsxmake.make(2012) , vsxmake2013 = vsxmake.make(2013) , vsxmake2015 = vsxmake.make(2015) , vsxmake2017 = vsxmake.make(2017) , vsxmake2019 = vsxmake.make(2019) - , vsxmake = _vsxmake + , vsxmake = vsxmake.make() , compile_flags = compile_flags.make , compile_commands = compile_commands.make } diff --git a/xmake/plugins/project/vstudio/vs.lua b/xmake/plugins/project/vstudio/vs.lua index a50180a23..e108ef22f 100644 --- a/xmake/plugins/project/vstudio/vs.lua +++ b/xmake/plugins/project/vstudio/vs.lua @@ -20,16 +20,27 @@ -- imports import("impl.vs200x") +import("impl.vs201x") import("impl.vsinfo") -- make factory function make(version) + if not version then + version = assert(tonumber(config.get("vs")), "invalid vs version, run `xmake f --vs=2015`") + vprint("using project kind vs%d", version) + end + -- get vs version info local info = vsinfo(version) - -- make - return function(outputdir) - vs200x.make(outputdir, info) + if vsver < 2010 then + return function(outputdir) + vs200x.make(outputdir, info) + end + else + return function(outputdir) + vs201x.make(outputdir, info) + end end end diff --git a/xmake/plugins/project/vstudio/vsx.lua b/xmake/plugins/project/vstudio/vsx.lua deleted file mode 100644 index ff8b83281..000000000 --- a/xmake/plugins/project/vstudio/vsx.lua +++ /dev/null @@ -1,35 +0,0 @@ ---!A cross-platform build utility based on Lua --- --- Licensed under the Apache License, Version 2.0 (the "License"); --- you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. --- --- Copyright (C) 2015 - 2019, TBOOX Open Source Group. --- --- @author ruki --- @file vsx.lua --- - --- imports -import("impl.vs201x") -import("impl.vsinfo") - --- make factory -function make(version) - - -- get vs version info - local info = vsinfo(version) - - -- make - return function(outputdir) - vs201x.make(outputdir, info) - end -end diff --git a/xmake/plugins/project/vsxmake/vsxmake.lua b/xmake/plugins/project/vsxmake/vsxmake.lua index ac9e27c85..785569aef 100644 --- a/xmake/plugins/project/vsxmake/vsxmake.lua +++ b/xmake/plugins/project/vsxmake/vsxmake.lua @@ -129,6 +129,11 @@ end -- make function make(version) + if not version then + version = assert(tonumber(config.get("vs")), "invalid vs version, run `xmake f --vs=2015`") + vprint("using project kind vsxmake%d", version) + end + -- check if version < 2010 then raise("vsxmake does not support vs version lower than 2010") |
