Check for compiler flags before using them.
See https://quickgit.kde.org/?p=kdevplatform.git&a=commit&h=210a8f10d63edb5bb68d590db9b37b9c4daf6bec