Building Linux client -- is -fno-exceptions required?

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Building Linux client -- is -fno-exceptions required?

Postby Plinker1961 » Tue May 10, 2016 9:23 am

While porting our (modified) CEF Client code to the Linux version of CEF, I discovered that parts of our client did not build because CMakeList.txt instructs CMake to compile with -fno-exceptions. But our version of the CEF client includes a smattering of try/catch blocks in support of limited serial I/O and database support, which don't work with the -fno-exceptions switch.

My quick workaround was to add add_compile_options(-fexceptions) to the CMakeLists.txt file for CEFClient. This way, the wrapper library is still built with -fno-exceptions, but the client is built with exceptions enabled. Is this acceptable? Will it cause any unexpected problems?
Plinker1961
Mentor
 
Posts: 65
Joined: Thu Feb 26, 2015 5:14 pm

Re: Building Linux client -- is -fno-exceptions required?

Postby magreenblatt » Tue May 10, 2016 10:18 am

It should be OK if you build both libcef_dll_wrapper and your application with -fexceptions.
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: Building Linux client -- is -fno-exceptions required?

Postby Plinker1961 » Tue May 10, 2016 11:20 am

It's easy enough to set those both to use -fexceptions, just curious though as to why. Is the concern that I might get unexpected results if these are compiled with different settings?
Plinker1961
Mentor
 
Posts: 65
Joined: Thu Feb 26, 2015 5:14 pm

Re: Building Linux client -- is -fno-exceptions required?

Postby magreenblatt » Tue May 10, 2016 11:46 am

Plinker1961 wrote:It's easy enough to set those both to use -fexceptions, just curious though as to why. Is the concern that I might get unexpected results if these are compiled with different settings?

Right. They both link and share the standard library so you want to build them with the same configuration.
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: Building Linux client -- is -fno-exceptions required?

Postby Plinker1961 » Tue May 10, 2016 1:32 pm

Is there a technical reason the sample client uses -fno-exceptions?
Plinker1961
Mentor
 
Posts: 65
Joined: Thu Feb 26, 2015 5:14 pm

Re: Building Linux client -- is -fno-exceptions required?

Postby magreenblatt » Tue May 10, 2016 3:46 pm

Plinker1961 wrote:Is there a technical reason the sample client uses -fno-exceptions?

Yes. Because it doesn't use exceptions.
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 45 guests