|
@ -3,10 +3,20 @@ |
|
|
set_xmakever("2.5.3") |
|
|
set_xmakever("2.5.3") |
|
|
|
|
|
|
|
|
set_project("klotski-core") |
|
|
set_project("klotski-core") |
|
|
set_version("0.1.2") |
|
|
set_version("0.1.2", {build = "%Y-%m-%d %H:%M:%S"}) |
|
|
set_languages("cxx14") |
|
|
set_languages("cxx14") |
|
|
|
|
|
|
|
|
set_optimize("fastest") |
|
|
if is_mode("debug") then |
|
|
|
|
|
set_symbols("debug") |
|
|
|
|
|
set_optimize("none") |
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
if is_mode("release") then |
|
|
|
|
|
set_strip("all") |
|
|
|
|
|
set_symbols("hidden") |
|
|
|
|
|
set_optimize("fastest") |
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
set_warnings("everything") |
|
|
set_warnings("everything") |
|
|
|
|
|
|
|
|
---------------------------------------------------------------- |
|
|
---------------------------------------------------------------- |
|
@ -29,39 +39,48 @@ add_includedirs("benchmark") |
|
|
target("utils") |
|
|
target("utils") |
|
|
set_kind("object") |
|
|
set_kind("object") |
|
|
add_files("utils/*.cc") |
|
|
add_files("utils/*.cc") |
|
|
|
|
|
target_end() |
|
|
|
|
|
|
|
|
target("all_cases") |
|
|
target("all_cases") |
|
|
set_kind("object") |
|
|
set_kind("object") |
|
|
add_files("all_cases/*.cc") |
|
|
add_files("all_cases/*.cc") |
|
|
|
|
|
target_end() |
|
|
|
|
|
|
|
|
target("raw_code") |
|
|
target("raw_code") |
|
|
set_kind("object") |
|
|
set_kind("object") |
|
|
add_files("raw_code/*.cc") |
|
|
add_files("raw_code/*.cc") |
|
|
|
|
|
target_end() |
|
|
|
|
|
|
|
|
target("short_code") |
|
|
target("short_code") |
|
|
set_kind("object") |
|
|
set_kind("object") |
|
|
add_includedirs("short_code/offset") |
|
|
add_includedirs("short_code/offset") |
|
|
add_files("short_code/*.cc") |
|
|
add_files("short_code/*.cc") |
|
|
|
|
|
target_end() |
|
|
|
|
|
|
|
|
target("common_code") |
|
|
target("common_code") |
|
|
set_kind("object") |
|
|
set_kind("object") |
|
|
add_files("common_code/*.cc") |
|
|
add_files("common_code/*.cc") |
|
|
|
|
|
target_end() |
|
|
|
|
|
|
|
|
target("core") |
|
|
target("core") |
|
|
set_kind("object") |
|
|
set_kind("object") |
|
|
add_files("core/*.cc") |
|
|
add_files("core/*.cc") |
|
|
|
|
|
target_end() |
|
|
|
|
|
|
|
|
target("fast_cal") |
|
|
target("fast_cal") |
|
|
set_kind("object") |
|
|
set_kind("object") |
|
|
add_files("fast_cal/*.cc") |
|
|
add_files("fast_cal/*.cc") |
|
|
|
|
|
target_end() |
|
|
|
|
|
|
|
|
target("analyse") |
|
|
target("analyse") |
|
|
set_kind("object") |
|
|
set_kind("object") |
|
|
add_files("analyse/*.cc") |
|
|
add_files("analyse/*.cc") |
|
|
|
|
|
target_end() |
|
|
|
|
|
|
|
|
target("benchmark") |
|
|
target("benchmark") |
|
|
set_kind("object") |
|
|
set_kind("object") |
|
|
add_files("benchmark/*.cc") |
|
|
add_files("benchmark/*.cc") |
|
|
|
|
|
target_end() |
|
|
|
|
|
|
|
|
---------------------------------------------------------------- |
|
|
---------------------------------------------------------------- |
|
|
|
|
|
|
|
@ -70,30 +89,51 @@ target("klotski-ffi") |
|
|
add_includedirs(".") |
|
|
add_includedirs(".") |
|
|
add_files("ffi/*.cc") |
|
|
add_files("ffi/*.cc") |
|
|
|
|
|
|
|
|
set_configvar("COMPILER", "GCC ...") |
|
|
-- TODO: get compiler name and version |
|
|
set_configvar("BUILD_TIME", "...time...") |
|
|
set_configvar("COMPILER", "XMake") |
|
|
|
|
|
|
|
|
set_configdir("$(projectdir)/utils") |
|
|
set_configdir("$(projectdir)/utils") |
|
|
add_configfiles("utils/metadata.h.in", { |
|
|
add_configfiles("utils/metadata.h.in", { |
|
|
filename = "metadata.h", pattern = "@(.-)@" |
|
|
filename = "metadata.h", pattern = "@(.-)@" |
|
|
}) |
|
|
}) |
|
|
|
|
|
target_end() |
|
|
|
|
|
|
|
|
---------------------------------------------------------------- |
|
|
---------------------------------------------------------------- |
|
|
|
|
|
|
|
|
target("klotski") |
|
|
target("klotski") |
|
|
set_kind("static") |
|
|
set_kind("static") |
|
|
|
|
|
|
|
|
add_deps("klotski-ffi") |
|
|
add_deps("klotski-ffi") |
|
|
add_deps("utils", "all_cases") |
|
|
add_deps("utils", "all_cases") |
|
|
add_deps("raw_code", "short_code", "common_code") |
|
|
add_deps("raw_code", "short_code", "common_code") |
|
|
add_deps("core", "fast_cal", "analyse") |
|
|
add_deps("core", "fast_cal", "analyse") |
|
|
add_deps("benchmark") |
|
|
add_deps("benchmark") |
|
|
|
|
|
|
|
|
set_policy("build.merge_archive", true) |
|
|
set_policy("build.merge_archive", true) |
|
|
set_targetdir("$(projectdir)/../../bin/") |
|
|
|
|
|
|
|
|
|
|
|
after_build(function (target) |
|
|
after_build(function (target) |
|
|
os.cp("$(projectdir)/klotski.h", "$(projectdir)/../../bin/") |
|
|
import("core.project.config") |
|
|
|
|
|
|
|
|
|
|
|
-- local target_file = target:targetfile() |
|
|
|
|
|
|
|
|
|
|
|
os.cp(target:targetfile(), "$(projectdir)/bin/") |
|
|
|
|
|
os.cp("$(scriptdir)/klotski.h", "$(projectdir)/bin/") |
|
|
|
|
|
|
|
|
end) |
|
|
end) |
|
|
|
|
|
|
|
|
|
|
|
-- before_build(function(target) |
|
|
|
|
|
-- print("23333 -> $(scriptdir)") |
|
|
|
|
|
-- os.cp("$(scriptdir)/xxx.h", "$(buildir)/inc") |
|
|
|
|
|
|
|
|
|
|
|
-- set_targetdir("$(scriptdir)/../../bin/") |
|
|
|
|
|
|
|
|
|
|
|
-- end) |
|
|
|
|
|
|
|
|
|
|
|
-- print("23333 -> $(scriptdir)") |
|
|
|
|
|
|
|
|
|
|
|
-- set_targetdir("$(scriptdir)/../../bin/") |
|
|
|
|
|
|
|
|
|
|
|
-- after_build(function (target) |
|
|
|
|
|
-- os.cp("$(projectdir)/klotski.h", "$(projectdir)/../../bin/") |
|
|
|
|
|
-- end) |
|
|
|
|
|
target_end() |
|
|
|
|
|
|
|
|
---------------------------------------------------------------- |
|
|
---------------------------------------------------------------- |
|
|