summaryrefslogtreecommitdiffstats
path: root/Source/cmCallVisualStudioMacro.cxx
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2008-10-08 18:19:01 (GMT)
committerDavid Cole <david.cole@kitware.com>2008-10-08 18:19:01 (GMT)
commitfdb0c8758a54a929dca054f4630812b5d6d617b3 (patch)
treeb8b34d20a32a1791e756d19437cf9979e14aa316 /Source/cmCallVisualStudioMacro.cxx
parent25a5c34a62c50d4dc873c04d0896e3ba3e234f56 (diff)
downloadCMake-fdb0c8758a54a929dca054f4630812b5d6d617b3.zip
CMake-fdb0c8758a54a929dca054f4630812b5d6d617b3.tar.gz
CMake-fdb0c8758a54a929dca054f4630812b5d6d617b3.tar.bz2
BUG: Fix issue #7533. Revise fix for issue #7058 to use pragma comment libs in the source file rather than using TARGET_LINK_LIBRARIES in CMakeLists.txt because of the complex ifdef logic used in correct copies of comdef.h.
Diffstat (limited to 'Source/cmCallVisualStudioMacro.cxx')
-rw-r--r--Source/cmCallVisualStudioMacro.cxx25
1 files changed, 25 insertions, 0 deletions
diff --git a/Source/cmCallVisualStudioMacro.cxx b/Source/cmCallVisualStudioMacro.cxx
index 2aefd20..0837108 100644
--- a/Source/cmCallVisualStudioMacro.cxx
+++ b/Source/cmCallVisualStudioMacro.cxx
@@ -36,6 +36,31 @@ static bool LogErrorsAsMessages;
//----------------------------------------------------------------------------
+// Copied from a correct comdef.h to avoid problems with deficient versions
+// of comdef.h that exist in the wild... Fixes issue #7533.
+//
+#if ( _MSC_VER >= 1300 )
+// VS7 and later:
+#ifdef _NATIVE_WCHAR_T_DEFINED
+# ifdef _DEBUG
+# pragma comment(lib, "comsuppwd.lib")
+# else
+# pragma comment(lib, "comsuppw.lib")
+# endif
+#else
+# ifdef _DEBUG
+# pragma comment(lib, "comsuppd.lib")
+# else
+# pragma comment(lib, "comsupp.lib")
+# endif
+#endif
+#else
+// VS6 only had comsupp.lib:
+# pragma comment(lib, "comsupp.lib")
+#endif
+
+
+//----------------------------------------------------------------------------
///! Use ReportHRESULT to make a cmSystemTools::Message after calling
///! a COM method that may have failed.
#define ReportHRESULT(hr, context) \