From e2335bd44dd49824e17e9414c0c3a3566cb0e69b Mon Sep 17 00:00:00 2001 From: Chanchan Date: Tue, 17 Jan 2023 22:27:17 +0800 Subject: [PATCH 1/3] fix : macos shraed lib install --- src/xmake.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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) From 77c0132b6b44074efce8e93213e621e311fd252a Mon Sep 17 00:00:00 2001 From: Chanchan Date: Thu, 19 Jan 2023 20:54:10 +0800 Subject: [PATCH 2/3] fix : O2 level && no hidden symbol --- xmake.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xmake.lua b/xmake.lua index e0cf2095..fbc3737b 100644 --- a/xmake.lua +++ b/xmake.lua @@ -10,7 +10,13 @@ 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") +elseif is_mode("debug") then + set_symbols("debug") + set_optimize("none") +end + set_languages("c90", "c++11") set_warnings("all") set_exceptions("no-cxx") From 6870a41c65f885cf0b590a74bb6d330935d6a499 Mon Sep 17 00:00:00 2001 From: Chanchan Date: Thu, 19 Jan 2023 21:00:38 +0800 Subject: [PATCH 3/3] fix : add strip all --- xmake.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/xmake.lua b/xmake.lua index fbc3737b..6b490c1b 100644 --- a/xmake.lua +++ b/xmake.lua @@ -12,6 +12,7 @@ option("memcheck", {description = "valgrind memcheck", default = false}) if is_mode("release") then set_optimize("faster") + set_strip("all") elseif is_mode("debug") then set_symbols("debug") set_optimize("none")