From b673bd17ca0bc1a27ea5e16e1a7f45d873cba929 Mon Sep 17 00:00:00 2001 From: Inari0 <42310255+xq114@users.noreply.github.com> Date: Fri, 20 Dec 2024 15:00:59 +0800 Subject: add profile mode for windows --- xmake/rules/mode/xmake.lua | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/xmake/rules/mode/xmake.lua b/xmake/rules/mode/xmake.lua index 308dec90f..06aeffdcb 100644 --- a/xmake/rules/mode/xmake.lua +++ b/xmake/rules/mode/xmake.lua @@ -156,10 +156,15 @@ rule("mode.profile") end end - -- enable gprof - target:add("cxflags", "-pg") - target:add("mxflags", "-pg") - target:add("ldflags", "-pg") + if target:is_plat("windows") then + -- enable vs profile + target:add("ldflags", "/profile") + else + -- enable gprof + target:add("cxflags", "-pg") + target:add("mxflags", "-pg") + target:add("ldflags", "-pg") + end -- enable NDEBUG macros to disables standard-C assertions target:add("cxflags", "-DNDEBUG") -- cgit v1.3.1