diff options
| author | ruki <[email protected]> | 2022-08-20 23:05:20 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-08-20 23:05:28 +0800 |
| commit | ca8cef5bfdde703586e90760f80fb8e1095d3ebc (patch) | |
| tree | 994cdf4dbaff2e8facf81fed707c27e14635a521 /xmake/modules/detect/tools/gcc/has_flags.lua | |
| parent | 32fa15ce715e20617c01a1cfb02babd50a92e293 (diff) | |
improve armclang/has_flags
Diffstat (limited to 'xmake/modules/detect/tools/gcc/has_flags.lua')
| -rw-r--r-- | xmake/modules/detect/tools/gcc/has_flags.lua | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/xmake/modules/detect/tools/gcc/has_flags.lua b/xmake/modules/detect/tools/gcc/has_flags.lua index 8f019a36a..64fa70df8 100644 --- a/xmake/modules/detect/tools/gcc/has_flags.lua +++ b/xmake/modules/detect/tools/gcc/has_flags.lua @@ -73,21 +73,6 @@ function _get_extension(opt) return (opt.program:endswith("++") or opt.flagkind == "cxxflags") and ".cpp" or (table.wrap(language.sourcekinds()[opt.toolkind or "cc"])[1] or ".c") end --- has `-S` flag? -function _has_flag_S(opt) - local has_flag_S = _g.has_flag_S - if has_flag_S == nil then - if opt.program:find("armclang", 1, true) then - -- it is disallowed in ARM compiler - has_flag_S = false - else - has_flag_S = true - end - _g.has_flag_S = has_flag_S - end - return has_flag_S -end - -- try running to check flags function _check_try_running(flags, opt, islinker) @@ -105,11 +90,7 @@ function _check_try_running(flags, opt, islinker) -- check flags for compiler -- @note we cannot use os.nuldev() as the output file, maybe run failed for some flags, e.g. --coverage - local extraflags = {} - if _has_flag_S(opt) then - table.insert(extraflags, "-S") - end - return _try_running(opt.program, table.join(flags, extraflags, "-o", tmpfile, sourcefile), opt) + return _try_running(opt.program, table.join(flags, "-S", "-o", tmpfile, sourcefile), opt) end -- has_flags(flags)? |
