From 29511c86a2dd782bdb8b1d41e26aeb6a7ad3cc42 Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Sun, 29 Jan 2023 12:06:26 +0800 Subject: [PATCH] build: xmake compile configure --- .gitignore | 4 +- ...rack_legacy.cc => backtrack_legacy.cc.bak} | 0 src/klotski_core/xmake.lua | 80 +++++++++++++++++++ 3 files changed, 82 insertions(+), 2 deletions(-) rename src/klotski_core/analyse/{backtrack_legacy.cc => backtrack_legacy.cc.bak} (100%) create mode 100644 src/klotski_core/xmake.lua diff --git a/.gitignore b/.gitignore index 72068ef..2fa6e20 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,8 @@ /bin/ /.idea/ +**/.xmake/ +/src/cli/target/ /cmake-build-debug/ /cmake-build-release/ - -/src/cli/target/ /src/rust_ffi/target/ /src/klotski_core/utils/version.h diff --git a/src/klotski_core/analyse/backtrack_legacy.cc b/src/klotski_core/analyse/backtrack_legacy.cc.bak similarity index 100% rename from src/klotski_core/analyse/backtrack_legacy.cc rename to src/klotski_core/analyse/backtrack_legacy.cc.bak diff --git a/src/klotski_core/xmake.lua b/src/klotski_core/xmake.lua new file mode 100644 index 0000000..9bbee92 --- /dev/null +++ b/src/klotski_core/xmake.lua @@ -0,0 +1,80 @@ +target("utils") + set_kind("static") + add_files("utils/*.cc") + +target("all_cases") + set_kind("static") + add_includedirs("utils") + add_files("all_cases/*.cc") + +target("raw_code") + set_kind("static") + add_includedirs("utils") + add_includedirs("raw_code") + add_includedirs("short_code") + add_includedirs("common_code") + add_files("raw_code/*.cc") + +target("short_code") + set_kind("static") + add_includedirs("utils") + add_includedirs("all_cases") + add_includedirs("raw_code") + add_includedirs("short_code") + add_includedirs("common_code") + add_includedirs("short_code/offset") + add_files("short_code/*.cc") + +target("common_code") + set_kind("static") + add_includedirs("utils") + add_includedirs("raw_code") + add_includedirs("short_code") + add_includedirs("common_code") + add_files("common_code/*.cc") + +target("core") + set_kind("static") + add_includedirs("utils") + add_files("core/*.cc") + +target("fast_cal") + set_kind("static") + add_includedirs("core") + add_includedirs("utils") + add_includedirs("raw_code") + add_includedirs("short_code") + add_includedirs("common_code") + add_files("fast_cal/*.cc") + +target("analyse") + set_kind("static") + add_includedirs("core") + add_includedirs("utils") + add_includedirs("raw_code") + add_includedirs("short_code") + add_includedirs("common_code") + add_files("analyse/*.cc") + +target("benchmark") + set_kind("static") + add_includedirs("all_cases") + add_files("benchmark/*.cc") + +-- TODO: generate version.h + +target("klotski") + set_kind("static") + add_includedirs(".") + add_includedirs("utils") + add_includedirs("all_cases") + add_includedirs("benchmark") + add_includedirs("raw_code") + add_includedirs("short_code") + add_includedirs("common_code") + add_deps("utils", "all_cases") + add_deps("raw_code", "short_code", "common_code") + add_deps("core", "fast_cal", "analyse") + add_deps("benchmark") + add_files("ffi/*.cc") + set_policy("build.merge_archive", true)