diff options
| author | ruki <[email protected]> | 2023-05-06 09:21:38 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-05-06 09:21:38 +0800 |
| commit | 91633b648d6ce1505df22dc1a400e283ea90f512 (patch) | |
| tree | aa4ccaa632d2b8fffcb7801a0d0ba9e6da23d39c | |
| parent | e705d24f4f0bb7194e01e18bb94dbf4261b9b8d6 (diff) | |
improve msbuild
| -rw-r--r-- | xmake/modules/package/tools/msbuild.lua | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/xmake/modules/package/tools/msbuild.lua b/xmake/modules/package/tools/msbuild.lua index 1524329b6..2de6ff91c 100644 --- a/xmake/modules/package/tools/msbuild.lua +++ b/xmake/modules/package/tools/msbuild.lua @@ -55,11 +55,16 @@ end function _get_configs(package, configs, opt) local jobs = _get_parallel_njobs(opt) configs = configs or {} + local configs_str = string.serialize(configs, {indent = false, strip = true}) table.insert(configs, "-nologo") table.insert(configs, "-t:Rebuild") table.insert(configs, (jobs ~= nil and format("-m:%d", jobs) or "-m")) - table.insert(configs, "-p:Configuration=" .. (package:is_debug() and "Debug" or "Release")) - table.insert(configs, "-p:Platform=" .. _get_vsarch(package)) + if not configs_str:find("p:Configuration=", 1, true) then + table.insert(configs, "-p:Configuration=" .. (package:is_debug() and "Debug" or "Release")) + end + if not configs_str:find("p:Platform=", 1, true) then + table.insert(configs, "-p:Platform=" .. _get_vsarch(package)) + end return configs end |
