Skip to content

Commit d0df7a4

Browse files
committed
toolchain: use mingw to replace msvc on windows
1 parent 2c46e70 commit d0df7a4

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

config.xlings

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
xname = "mcpp-standard" -- project name
22

33
-- xim-deps
4-
xdeps = {
4+
xim = {
55
vscode = "",
6-
cpp = "", -- language
6+
cpp = "", -- language:[windows:mingw], [linux:gcc], [macos:clang]
77
mdbook = "0.4.43", -- for d2x book
88
}
99

@@ -23,11 +23,10 @@ d2x = {
2323

2424
private = {
2525
-- project private attributes
26+
mcpp = {
27+
lang = "en", -- option: en, zh
28+
}
2629
},
2730
}
2831

2932
--xlings_llm_config = "llm.config.xlings"
30-
31-
mcpp = {
32-
lang = "en", -- option: en, zh
33-
}

dslings/xmake.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
if is_host("windows") then
22
set_encodings("source:utf-8", "target:utf-8")
3+
set_toolchains("gcc")
4+
add_ldflags("-static")
35
end
46

5-
if mcpp.lang == "zh" then
7+
if d2x.private.mcpp.lang == "zh" then
68
add_includedirs(".")
79

810
target("00-0-hello-mcpp")

0 commit comments

Comments
 (0)