Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8409


Ignore:
Timestamp:
May 6, 2011, 3:37:01 AM (14 years ago)
Author:
rgrieder
Message:

Found a better solution to make the Visual Leak Detector (MSVC specific) work so that it doesn't need to be included in every single source file.

Location:
code/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/cmake/tools/TargetUtilities.cmake

    r8405 r8409  
    304304  ENDIF()
    305305
     306  # Visual Leak Detector specific stuff (avoids the include)
     307  IF(HAVE_VLD)
     308    TARGET_LINK_LIBRARIES(${_target_name} ${VLD_LIBRARY})
     309  ENDIF()
     310
    306311  # RPATH settings for the installation
    307312  IF("${_target_type}" STREQUAL "LIBRARY")
  • code/trunk/src/OrxonoxConfig.cmake

    r8368 r8409  
    9292      SET(VISUAL_LEAK_DETECTOR_ENABLE off)
    9393    ENDIF()
     94    SET(VLD_LIBRARY vld.lib)
     95    # Force symbol reference
     96    # The alternative would be to include vld.h everywhere (includes windows.h)
     97    ADD_LINKER_FLAGS("-INCLUDE:__imp_?vld@@3VVisualLeakDetector@@A" Debug)
    9498  ENDIF()
    9599  MARK_AS_ADVANCED(VLD_DLL)
  • code/trunk/src/OrxonoxConfig.h.in

    r8368 r8409  
    185185    || defined(CMAKE_RelWithDebInfo_BUILD)
    186186#  define ORXONOX_RELEASE
    187 #endif
    188 
    189 // Include memory leak detector if available and not building actual release
    190 #cmakedefine HAVE_VLD
    191 #if defined(HAVE_VLD) && !defined(NDEBUG)
    192 typedef uint32_t UINT32;
    193 typedef wchar_t WCHAR;
    194 struct HINSTANCE__;
    195 typedef struct HINSTANCE__* HINSTANCE;
    196 typedef HINSTANCE HMODULE;
    197 #  ifndef NULL
    198 #    define NULL 0
    199 #  endif
    200 #  include <vld.h>
    201187#endif
    202188
Note: See TracChangeset for help on using the changeset viewer.