Skip to content

Commit 8346433

Browse files
committed
try improve windows shared build
1 parent 75972c4 commit 8346433

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

packages/a/aui/xmake.lua

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,21 @@ package("aui")
144144
"-DAUIB_NO_PRECOMPILED=TRUE",
145145
"-DAUIB_DISABLE=ON"
146146
}
147-
if package:is_plat("windows") and package:is_arch("arm64") then
148-
io.replace("cmake/aui.build.cmake", [[if (CMAKE_GENERATOR_PLATFORM MATCHES "(arm64)|(ARM64)" OR CMAKE_SYSTEM_PROCESSOR MATCHES "(aarch64|arm64)")]], [[if (1)]], {plain = true})
147+
local opt = {}
148+
if package:is_plat("windows") then
149+
if package:config("shared") then
150+
opt.packagedeps = {"glew"}
151+
end
152+
if package:has_tool("cxx", "cl", "clang_cl") then
153+
opt.cxflags = {"/EHsc"}
154+
end
155+
if package:is_arch("arm64") then
156+
io.replace("cmake/aui.build.cmake", [[if (CMAKE_GENERATOR_PLATFORM MATCHES "(arm64)|(ARM64)" OR CMAKE_SYSTEM_PROCESSOR MATCHES "(aarch64|arm64)")]], [[if (1)]], {plain = true})
157+
end
149158
end
150159
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
151160
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
152-
import("package.tools.cmake").install(package, configs)
161+
import("package.tools.cmake").install(package, configs, opt)
153162
end)
154163

155164
on_test(function (package)

0 commit comments

Comments
 (0)