]> granicus.if.org Git - taglib/commitdiff
Compilation fix for Visual C++ .NET 2003 (msvc71)
authorTanguy Krotoff <tkrotoff@gmail.com>
Sun, 7 Jun 2009 23:07:32 +0000 (23:07 +0000)
committerTanguy Krotoff <tkrotoff@gmail.com>
Sun, 7 Jun 2009 23:07:32 +0000 (23:07 +0000)
Explanations:
/Zc:wchar_t is recognized by msvc71, /Zc:wchar_t- is not (the - is important and was introduced only with msvc >= msvc80)
Thus /Zc:wchar_t- is recognized as /Zc:wchar_t and this is not what we want :)
Default behavior of msvc71 is already /Zc:wchar_t-

Solution:
Test the msvc version and add the compiler flag only if compiler >= msvc80 (e.g MSVC_VERSION >= 1400)
Same for /D_CRT_SECURE_NO_DEPRECATE and /D_CRT_NONSTDC_NO_DEPRECATE, there were introduced with msvc >= msvc80

git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@978720 283d02a7-25f6-0310-bc7c-ecb5cbfe19da

CMakeLists.txt

index fabee91f0368a4c4e78d2e7c74bab99139b51e88..d197c4994446be9174a5cab1dab8b8f8ebbca02b 100644 (file)
@@ -27,7 +27,10 @@ if (CMAKE_COMPILER_IS_GNUCXX)
    endif (CMAKE_SYSTEM_NAME MATCHES Linux)
 endif (CMAKE_COMPILER_IS_GNUCXX)
 if(MSVC)
-  add_definitions( -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE )
+  if (MSVC_VERSION GREATER 1399)
+    # If using Visual C++ 2005 (MSVC80) and greater (MSVC_VERSION=1400)
+    add_definitions(/D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /Zc:wchar_t-)
+  endif (MSVC_VERSION GREATER 1399)
 endif(MSVC)
 if (WIN32)
   set(CMAKE_DEBUG_POSTFIX "d")