From a59bbcc95273b324f298da92e9171585abf10e87 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 24 Jun 2014 11:30:27 -0700 Subject: Fix ICC build on Windows: __VERSION__ isn't defined So let's define the version ourselves. This is done for all OS because __VERSION__ doesn't include the actual compiler version... Change-Id: Ida706a8f4bfe75af04ce8f11ea2124c1659c19ce Reviewed-by: Oswald Buddenhagen Reviewed-by: Friedemann Kleint Reviewed-by: Thiago Macieira --- src/corelib/global/qlibraryinfo.cpp | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'src/corelib/global') diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp index a897ce5831..dce75d4bdd 100644 --- a/src/corelib/global/qlibraryinfo.cpp +++ b/src/corelib/global/qlibraryinfo.cpp @@ -258,7 +258,35 @@ QLibraryInfo::buildDate() #endif //QT_NO_DATESTRING #if defined(Q_CC_INTEL) // must be before GNU, Clang and MSVC because ICC/ICL claim to be them -# define COMPILER_STRING __VERSION__ /* __VERSION__ starts with "Intel(R) C++" */ +# ifdef __INTEL_CLANG_COMPILER +# define ICC_COMPAT "Clang" +# elif defined(__INTEL_MS_COMPAT_LEVEL) +# define ICC_COMPAT "Microsoft" +# elif defined(__GNUC__) +# define ICC_COMPAT "GCC" +# else +# define ICC_COMPAT "no" +# endif +# if __INTEL_COMPILER == 1300 +# define ICC_VERSION "13.0" +# elif __INTEL_COMPILER == 1310 +# define ICC_VERSION "13.1" +# elif __INTEL_COMPILER == 1400 +# define ICC_VERSION "14.0" +# elif __INTEL_COMPILER == 1500 +# define ICC_VERSION "15.0" +# else +# define ICC_VERSION QT_STRINGIFY(__INTEL_COMPILER) +# endif +# ifdef __INTEL_COMPILER_UPDATE +# define COMPILER_STRING "Intel(R) C++ " ICC_VERSION "." QT_STRINGIFY(__INTEL_COMPILER_UPDATE) \ + " build " QT_STRINGIFY(__INTEL_COMPILER_BUILD_DATE) " [" \ + ICC_COMPAT " compatibility]" +# else +# define COMPILER_STRING "Intel(R) C++ " ICC_VERSION \ + " build " QT_STRINGIFY(__INTEL_COMPILER_BUILD_DATE) " [" \ + ICC_COMPAT " compatibility]" +# endif #elif defined(Q_CC_CLANG) // must be before GNU, because clang claims to be GNU too # ifdef __apple_build_version__ // Apple clang has other version numbers # define COMPILER_STRING "Clang " __clang_version__ " (Apple)" -- cgit v1.2.3