From 979023e54bc5d11db19c0df7e181c3824f18dc41 Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 25 Apr 2024 22:50:13 +0800 Subject: [PATCH] improve check flags #5000 --- xmake/modules/private/check/checkers/api/api_checker.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/xmake/modules/private/check/checkers/api/api_checker.lua b/xmake/modules/private/check/checkers/api/api_checker.lua index 375e27354c4..7da86af0db3 100644 --- a/xmake/modules/private/check/checkers/api/api_checker.lua +++ b/xmake/modules/private/check/checkers/api/api_checker.lua @@ -145,10 +145,12 @@ function check_flag(target, toolinst, flagkind, flag) local extraconf = target:extraconf(flagkind) flag = target_utils.flag_belong_to_tool(target, flag, toolinst, extraconf) if flag then - return toolinst:has_flags(flag) - else - return true + extraconf = extraconf and extraconf[flag] + if not extraconf or not extraconf.force then + return toolinst:has_flags(flag) + end end + return true end -- check api configuration in targets