open-webrtc-toolkit / owt-client-native

Open WebRTC Toolkit client SDK for native Windows/Linux/iOS applications.
https://01.org/open-webrtc-toolkit
Apache License 2.0
392 stars 181 forks source link

iOS build error,error: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'? [-Werror,-Wunknown-warning-option] #609

Open HongBryan opened 2 years ago

HongBryan commented 2 years ago

/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]

chuigda commented 1 year ago

(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.

dragon8609 commented 1 year ago

edit the build/config/compiler/BUILD.gn

replace the -Wno-unused-but-set-variable to -Wno-unused-const-variable , only two position.