owt-client-native
owt-client-native copied to clipboard
iOS build error,error: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'? [-Werror,-Wunknown-warning-option]
/Developer/SDKs/iPhoneOS15.2.sdk -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wexit-time-destructors -Wglobal-constructors -Wno-shorten-64-to-32 -Wno-undefined-bool-conversion -Wno-tautological-undefined-compare -std=c++14 -fno-trigraphs -Wno-trigraphs -fno-exceptions -fno-rtti -c ../../third_party/webrtc/system_wrappers/source/field_trial.cc -o obj/third_party/webrtc/system_wrappers/field_trial/field_trial.o error: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'? [-Werror,-Wunknown-warning-option] error: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'? [-Werror,-Wunknown-warning-option]
(Though may be a bit late) I had similar issue when building Linux SDK (version 4.3). I resolved this by "hijacking" GCC:
#!/usr/bin/env python3
import os, sys
process = sys.argv[0] + '-back'
args = []
for arg in sys.argv:
if arg == '-Werror':
print('Some swear words')
else:
args.append(arg)
args.append('-Wno-error')
os.execvp(process, args)
I renamed g++
to g++-back
, named the script above as g++
and put that to my /usr/bin
. Thus -Werror
would be automatically removed.
There should be some .gn
or .gni
file that wrongly enabled the -Werror
option or so, modifying it could be a better choice.
edit the build/config/compiler/BUILD.gn
replace the -Wno-unused-but-set-variable to -Wno-unused-const-variable , only two position.