Simd features on specific files - cannot enable exceptions
-
Hi,
i want to enable sse and avx just for specific source files. This works, but i'm using on some other files exceptions and i cannot prevent qmake to not generate CXXFlags with -fno_exceptions. If i delete -fno_expcetions at the generated makefile the static lib does compile at all.
My pro-file looks like this:
# target should be a non-qt static lib CONFIG -= qt CONFIG += staticlib CONFIG += warn_on c++11 debug_and_release exceptions simd TEMPLATE = lib TAREGET = mylibrary INCLUDEPATH += include SSE2_SOURCES += fooSse2.cpp AVX2_SOURCES +=fooAvx2.cpp SOURCES += bar.cpp
Does somebody know why i cannot enable exceptions???
-
The static lib does not compile: -fno_exceptions
Compiler output:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -O2 -fPIC -std=gnu++11 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -mmacosx-version-min=10.7 -Wall -W -fno-exceptions -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_EVDEV -DQT_NO_TSLIB -DQT_NO_LIBINPUT -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../../lib/libimagedecoder -I. -I../../../lib/include -I../../../lib/src -I../../../lib/other_headers -I/usr/local/opt/openssl/include -I/Users/asdf/Qt/5.6/clang_64/mkspecs/macx-clang -o .obj/IImageDecoder.o ../../../lib/foo.cpp ../../../lib/foo.cpp:123:6: error: cannot use 'throw' with exceptions disabled throw std::invalid_argument("The given arguments to ..." ^ ../../../lib/foo.cpp:203:6: error: cannot use 'throw' with exceptions disabled throw std::invalid_argument("The given arguments to ..." ^ 2 errors generated.
-
@manoh said:
The static lib does not compile: -fno_exceptions
I see. Perhaps I'm in error, it's been known to happen. They should be enabled by default (as per the
qmake
docs`), but try something like this:CONFIG -= qt exceptions_off CONFIG += staticlib CONFIG += warn_on c++11 debug_and_release exceptions simd
As a side question, what version of Qt (hence
qmake
) are you using?Kind regards.
-
Thanks for answers!
I tried this before i wrote my first post and this does not work :-( I think i have to write a custom compiler (after the weekend).
$ qmake -v QMake version 3.0 Using Qt version 5.6.0 in /Users/asdf/Qt/5.6/clang_64/lib
-
@manoh
I didn't usesimd
for my tests, only theexcetpions
/exceptions_off
options.I'm just getting forgetful in my old age. I did use
simd
, removing it fixes the issue. Where did that configuration option came from anyway? -
@manoh
To be honest I don't know if this is a bug, or expected behaviour. I advise asking on the interest mailing list how/if you can use that config option. Sorry, I couldn't be of more help.Kind regards.