[Orxonox-commit 3112] r7806 - in code/forks/sandbox_qt: cmake src

rgrieder at orxonox.net rgrieder at orxonox.net
Sun Dec 26 00:00:14 CET 2010


Author: rgrieder
Date: 2010-12-26 00:00:14 +0100 (Sun, 26 Dec 2010)
New Revision: 7806

Modified:
   code/forks/sandbox_qt/cmake/CompilerConfigMSVC.cmake
   code/forks/sandbox_qt/cmake/PackageConfigMSVC.cmake
   code/forks/sandbox_qt/src/CMakeLists.txt
   code/forks/sandbox_qt/src/OrxonoxConfig.cmake
   code/forks/sandbox_qt/src/OrxonoxConfig.h.in
Log:
Sorted out Visual Leak Detector issues (using new version 2 now).

Modified: code/forks/sandbox_qt/cmake/CompilerConfigMSVC.cmake
===================================================================
--- code/forks/sandbox_qt/cmake/CompilerConfigMSVC.cmake	2010-12-25 22:58:25 UTC (rev 7805)
+++ code/forks/sandbox_qt/cmake/CompilerConfigMSVC.cmake	2010-12-25 23:00:14 UTC (rev 7806)
@@ -35,17 +35,6 @@
 
 ######################## Options ########################
 
-# Currently VLD has a problem with MSVC9 although it actually is supported
-IF(MSVC80)
-  OPTION(VISUAL_LEAK_DETECTOR_ENABLE "Memory leak detector" off)
-ENDIF()
-# Make sure the value is "on" or "off" for vld.ini
-IF(VISUAL_LEAK_DETECTOR_ENABLE)
-  SET(VISUAL_LEAK_DETECTOR_ENABLE on)
-ELSE()
-  SET(VISUAL_LEAK_DETECTOR_ENABLE off)
-ENDIF()
-
 # Orxonox only supports MSVC 8 and above, which gets asserted above
 SET(PCH_COMPILER_SUPPORT TRUE)
 

Modified: code/forks/sandbox_qt/cmake/PackageConfigMSVC.cmake
===================================================================
--- code/forks/sandbox_qt/cmake/PackageConfigMSVC.cmake	2010-12-25 22:58:25 UTC (rev 7805)
+++ code/forks/sandbox_qt/cmake/PackageConfigMSVC.cmake	2010-12-25 23:00:14 UTC (rev 7806)
@@ -55,10 +55,4 @@
   # to specify the libraries ourselves.
   #SET(TCL_LIBRARY  ${DEP_LIBRARY_DIR}/tcl85.lib CACHE FILEPATH "")
 
-  # Visual Leak Detector
-  SET(VLD_INCLUDE_DIR  ${DEP_INCLUDE_DIR}/vld   CACHE PATH "")
-  SET(VLD_LIBRARY_DIR  ${DEP_LIBRARY_DIR}       CACHE PATH "")
-  LINK_DIRECTORIES(${VLD_LIBRARY_DIR}) # Used for auto-linking
-  MARK_AS_ADVANCED(VLD_INCLUDE_DIR VLD_LIBRARY_DIR)
-
 ENDIF(MSVC)

Modified: code/forks/sandbox_qt/src/CMakeLists.txt
===================================================================
--- code/forks/sandbox_qt/src/CMakeLists.txt	2010-12-25 22:58:25 UTC (rev 7805)
+++ code/forks/sandbox_qt/src/CMakeLists.txt	2010-12-25 23:00:14 UTC (rev 7806)
@@ -55,7 +55,6 @@
 # Set the search paths for include files
 INCLUDE_DIRECTORIES(
   # External
-  ${VLD_INCLUDE_DIR}
 
   # All includes in "externals" should be prefixed with the path
   # relative to "external" to avoid conflicts

Modified: code/forks/sandbox_qt/src/OrxonoxConfig.cmake
===================================================================
--- code/forks/sandbox_qt/src/OrxonoxConfig.cmake	2010-12-25 22:58:25 UTC (rev 7805)
+++ code/forks/sandbox_qt/src/OrxonoxConfig.cmake	2010-12-25 23:00:14 UTC (rev 7806)
@@ -78,6 +78,22 @@
 INCLUDE(CheckIncludeFileCXX)
 CHECK_INCLUDE_FILE_CXX(iso646.h HAVE_ISO646_H)
 
+IF(MSVC)
+  # Check whether we can use Visual Leak Detector
+  FIND_FILE(VLD_DLL vld_x86.dll)
+  IF(VLD_DLL)
+    SET(HAVE_VLD TRUE)
+    OPTION(VISUAL_LEAK_DETECTOR_ENABLE "Memory leak detector" off)
+    # Make sure the value is "on" or "off" for vld.ini
+    IF(VISUAL_LEAK_DETECTOR_ENABLE)
+      SET(VISUAL_LEAK_DETECTOR_ENABLE on)
+    ELSE()
+      SET(VISUAL_LEAK_DETECTOR_ENABLE off)
+    ENDIF()
+  ENDIF()
+  MARK_AS_ADVANCED(VLD_DLL)
+ENDIF()
+
 ############## Configured Headers ###############
 
 SET(GENERATED_FILE_COMMENT

Modified: code/forks/sandbox_qt/src/OrxonoxConfig.h.in
===================================================================
--- code/forks/sandbox_qt/src/OrxonoxConfig.h.in	2010-12-25 22:58:25 UTC (rev 7805)
+++ code/forks/sandbox_qt/src/OrxonoxConfig.h.in	2010-12-25 23:00:14 UTC (rev 7806)
@@ -178,9 +178,14 @@
 #endif
 */
 
-// Always include the memory leak detector for MSVC except for actual releases
-// Note: Although officially supported, VLD does not work with MSVC 9
-#if defined(ORXONOX_COMPILER_MSVC) && _MSC_VER < 1500 && !defined(ORXONOX_RELEASE)
+// Include memory leak detector if available and not building actual release
+#cmakedefine HAVE_VLD
+#if defined(HAVE_VLD) && !defined(ORXONOX_RELEASE)
+    typedef UINT32 uint32_t;
+    typedef wchar_t WCHAR;
+    struct HINSTANCE__ { int unused; };
+    typedef struct HINSTANCE__ * HINSTANCE;
+    typedef HINSTANCE HMODULE;
 #  include <vld.h>
 #endif
 




More information about the Orxonox-commit mailing list