From de084c146d75ebddf5ed773a61e4603a6f3ce085 Mon Sep 17 00:00:00 2001 From: taynpg Date: Wed, 8 Jan 2025 13:42:37 +0800 Subject: [PATCH] compile: add mingw xmake compile arg --- xmake.lua | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/xmake.lua b/xmake.lua index 2506f80..e114668 100644 --- a/xmake.lua +++ b/xmake.lua @@ -3,10 +3,26 @@ set_languages("c++17") if is_plat("windows") then add_cxxflags("/source-charset:utf-8") end +if is_plat("mingw") then + add_cxxflags("-Wno-unused-variable -finput-charset=utf-8 -fexec-charset=gbk") +end if is_mode("debug") then set_suffixname("d") end add_includedirs(path.join(os.scriptdir(), "include"), {public = true}) target("ofen") + add_options("boost") set_kind("static") - add_files("src/*.cpp") \ No newline at end of file + add_files("src/*.cpp") + +option("boost") + boost_root_dir = os.getenv("BOOST_HEADER_DIR") + boost_lib_dir = os.getenv("BOOST_LIB_DIR") + boost_libs = os.getenv("BOOST_LIBS") + add_includedirs(boost_root_dir) + print(boost_root_dir) + add_defines("USE_BOOST_FILESYSTEM") + add_linkdirs(boost_lib_dir) + print(boost_lib_dir) + add_links(boost_libs) + print(boost_libs) \ No newline at end of file