Passing ALL_BUILD.vcproj instead of <project>.sln to msbuild cause build fail
Xmake 版本
v2.9.9
操作系统版本和架构
Windows server 2008 r2 service pack1 x64 + visual studio 2008
描述问题
项目使用 xrepo 自己管理三方库,为了能够运行在低版本的 windows 上,三方库中的日志库选择了 log4cplus 1.0.4 版本,之前使用 xmakev2.6.2 能够正常编译三方库,最近升级了 xmake 导致编译失败。
期待的结果
编译成功
工程配置
log4cplus 配置如下:
on_load("linux", "windows", function (package)
local libpostfix = ""
if package:is_plat("windows") then
-- Windows 下静态库加 "S" 后缀,debug 版本加 "D" 后缀,unicode 加 "U" 后缀
libpostfix = libpostfix .. (package:config("shared") and "" or "S")
if package:config("unicode") then
package:add("defines", "UNICODE")
table.insert(export_configs["defines"], "UNICODE")
libpostfix = libpostfix .. "U"
end
libpostfix = libpostfix .. (package:debug() and "D" or "")
end
end)
on_install("windows", "linux", function (package)
if is_plat("windows") then
local argv = {
"-DCMAKE_INSTALL_PREFIX=" .. package:installdir(),
"-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"),
"-DLOG4CPLUS_BUILD_STATIC=" .. (package:config("shared") and "OFF" or "ON"),
"-DLOG4CPLUS_BUILD_UNICODE=" .. (package:config("unicode") and "ON" or "OFF"),
}
import("package.tools.cmake").install(package, argv)
end
end)
附加信息和错误日志
试试换成 ninja 构建 set_policy("package.cmake_generator.ninja", true)
Bot detected the issue body's language is not English, translate it automatically.
Try changing to ninja to build set_policy("package.cmake_generator.ninja", true)
升级新版本 不应该是 3.0.0 么。默认就是走的 ninja 而不是 msbuild 。。不存在这个问题
Bot detected the issue body's language is not English, translate it automatically.
Isn't it 3.0.0 to upgrade the new version? By default, it is ninja instead of msbuild. . This problem does not exist
升级新版本 不应该是 3.0.0 么。默认就是走的 ninja 而不是 msbuild 。。不存在这个问题
当时同事装的2.9.9, 不过看了 xmake 代码,3.0.0 应该存在同样的问题,虽然 xmake 现在使用 ninja 作为 cmake 默认的 generator,但是总不能不支持 visual studio 的 generator 了吧
Bot detected the issue body's language is not English, translate it automatically.
Isn't it 3.0.0 to upgrade the new version? By default, it is ninja instead of msbuild. . This problem does not exist
At that time, my colleague installed 2.9.9, but after reading the xmake code, there should be the same problem in 3.0.0. Although xmake now uses ninja as the default generator for cmake, it is impossible not to support the visual studio generator.
@ChrisCatCP 这个 patch 带进来的 https://github.com/xmake-io/xmake/pull/5523 还是去年的事情了,说明 2008 现在用的确实少。