Make stdlib exception include detection work with clang/libc++

Review Request #127074 - Created Feb. 14, 2016 and submitted

Information
Armin K.
akonadi
master
Reviewers
akonadi
dvratil

Currently, akonadi has some code to detect full path to C++ exception include.

This code doesn't work if -DCMAKE_CXX_COMPILER is set to "clang++ -stdlib=libc++", becaue cmake strips the second parameter, only leaving full path to the compiler.

It doesn't even work when I set -DCMAKE_CXX_FLAGS to "-stdlib=libc++" as the cmake module that looks for the include path doesn't use them. Even if I try to use them, clang chokes because there are some flags that shouldn't be passed in combination with -stdlib=libc++

The only sane path is this. If -DCXX_STDLIB is passed to cmake (ie, -DCXX_STDLIB=libc++), the cmake scriptlet only uses that flag. If nothing's passed to the variable, it's ignored.

Now builds with both clang++ -stdlib=libc++ and plain ol' g++

Daniel Vrátil
Armin K.
Review request changed

Status: Closed (submitted)

Change Summary:

Submitted with commit 036031f520ef1f5bdc40f9f9e8a2951be311eb3b by Armin K to branch master.
Loading...