From bb519403e5ab870a143f914470677fbe6a73bc15 Mon Sep 17 00:00:00 2001 From: taynpg Date: Thu, 5 Mar 2026 14:07:48 +0800 Subject: [PATCH] =?UTF-8?q?xmake=E5=BA=93=E4=BD=BF=E7=94=A8=E4=B8=8D?= =?UTF-8?q?=E5=90=8C=E7=BC=96=E8=AF=91=E5=99=A8=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Languages/xmake/使用记录.txt | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Languages/xmake/使用记录.txt b/Languages/xmake/使用记录.txt index b4b4012..6be3273 100644 --- a/Languages/xmake/使用记录.txt +++ b/Languages/xmake/使用记录.txt @@ -21,4 +21,19 @@ end target("zoost-use") set_kind("binary") add_files("src/*.cpp") - add_packages("zoost") \ No newline at end of file + add_packages("zoost") + +【1.1 如果当前环境有多个编译器,比如2个vs版本】 +可以尝试使用: +xrepo install -p windows --vs=2017 --toolchain=msvc zoost +xrepo install -p windows --vs=2022 --toolchain=msvc zoost +这种来指定不同的库版本。当然工程中也需要指定如xmake f --vs=2022 --toolchain=msvc来对应。 + +【2】xmake的基本配置 + +-c 表示清除之前的缓存。 +--toolchain=msvc 一般使用vs的时候最好也指定,不然有时候某些功能不生效。 + +1,配置debug,xmake f -m debug +2,指定vs2017,xmake f --vs=2017 --toolchain=msvc +3,重新构建,xmake --rebuild \ No newline at end of file