diff --git a/src/xmake.lua b/src/xmake.lua index 9158fcf7..697a1338 100644 --- a/src/xmake.lua +++ b/src/xmake.lua @@ -38,13 +38,17 @@ target("workflow") end) on_install(function (target) - os.mkdir(target:installdir("include")) - os.mkdir(target:installdir("lib")) + os.mkdir(path.join(target:installdir(), "include/workflow")) + os.mkdir(path.join(target:installdir(), "lib")) os.cp(path.join(get_config("workflow_inc"), "workflow"), path.join(target:installdir(), "include")) + shared_suffix = "*.so" + if is_plat("macosx") then + shared_suffix = "*.dylib" + end if target:is_static() then os.cp(path.join(get_config("workflow_lib"), "*.a"), path.join(target:installdir(), "lib")) else - os.cp(path.join(get_config("workflow_lib"), "*.so"), path.join(target:installdir(), "lib")) + os.cp(path.join(get_config("workflow_lib"), shared_suffix), path.join(target:installdir(), "lib")) end end) diff --git a/xmake.lua b/xmake.lua index e0cf2095..6b490c1b 100644 --- a/xmake.lua +++ b/xmake.lua @@ -10,7 +10,14 @@ option("redis", {description = "build redis component", default = true}) option("upstream", {description = "build upstream component", default = true}) option("memcheck", {description = "valgrind memcheck", default = false}) -add_rules("mode.release", "mode.debug") +if is_mode("release") then + set_optimize("faster") + set_strip("all") +elseif is_mode("debug") then + set_symbols("debug") + set_optimize("none") +end + set_languages("c90", "c++11") set_warnings("all") set_exceptions("no-cxx")