summaryrefslogtreecommitdiff
path: root/xmake/modules/detect/tools/gcc/has_flags.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2018-12-21 00:04:36 +0800
committerruki <[email protected]>2018-12-20 18:27:39 +0800
commitf1065f8b97b0521a57782eca4e9758929aebcd70 (patch)
tree75ebf78326fccf5dea0a06558603243fce8fed9a /xmake/modules/detect/tools/gcc/has_flags.lua
parentd95758dc85e1e34e6ce507ffee78f7634a0661c5 (diff)
improve has_flags tips
Diffstat (limited to 'xmake/modules/detect/tools/gcc/has_flags.lua')
-rw-r--r--xmake/modules/detect/tools/gcc/has_flags.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/xmake/modules/detect/tools/gcc/has_flags.lua b/xmake/modules/detect/tools/gcc/has_flags.lua
index e229e023a..a0cceda72 100644
--- a/xmake/modules/detect/tools/gcc/has_flags.lua
+++ b/xmake/modules/detect/tools/gcc/has_flags.lua
@@ -94,7 +94,8 @@ function _check_try_running(flags, opt, islinker)
if islinker then
-- get extension
- local extension = table.wrap(language.sourcekinds()[opt.toolkind or "cc"])[1] or ".c"
+ -- @note we need detect extension for ndk/clang++.exe: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
+ local extension = opt.program:endswith("++") and ".cpp" or (table.wrap(language.sourcekinds()[opt.toolkind or "cc"])[1] or ".c")
-- make an stub source file
local sourcefile = path.join(os.tmpdir(), "detect", "gcc_has_flags" .. extension)