Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8412


Ignore:
Timestamp:
May 7, 2011, 12:06:56 AM (13 years ago)
Author:
rgrieder
Message:

MSVC specific:
Sorted out Visual Leak Detector handling (it's now treated like a real library, not as a hack).
Also, the vld.h include is gone and with it windows.h.

Location:
code/trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/cmake/LibraryConfig.cmake

    r8351 r8412  
    129129  FIND_PACKAGE(DbgHelp)
    130130  FIND_PACKAGE(DirectX       REQUIRED)
     131  IF(MSVC)
     132    # Check whether we can use Visual Leak Detector
     133    FIND_PACKAGE(VLD QUIET)
     134  ENDIF()
    131135ENDIF()
    132136
  • code/trunk/cmake/tools/TargetUtilities.cmake

    r8409 r8412  
    305305
    306306  # Visual Leak Detector specific stuff (avoids the include)
    307   IF(HAVE_VLD)
    308     TARGET_LINK_LIBRARIES(${_target_name} ${VLD_LIBRARY})
     307  IF(VISUAL_LEAK_DETECTOR_ENABLE)
     308    TARGET_LINK_LIBRARIES(${_target_name} debug ${VLD_LIBRARY})
    309309  ENDIF()
    310310
  • code/trunk/src/CMakeLists.txt

    r8365 r8412  
    5454  ADD_COMPILER_FLAGS("-DNTDDI_VERSION=0x05010000")
    5555ENDIF(WIN32)
     56
     57# Visual Leak Dectector configuration
     58IF(MSVC AND VLD_FOUND)
     59  OPTION(VISUAL_LEAK_DETECTOR_ENABLE "Memory leak detector" OFF)
     60  IF(VISUAL_LEAK_DETECTOR_ENABLE)
     61    # Force library linking by forcing the inclusion of a symbol
     62    ADD_LINKER_FLAGS("-INCLUDE:__imp_?vld@@3VVisualLeakDetector@@A" Debug)
     63    IF(MSVC90)
     64      # VS 2008 incremental linker crashes with /INCLUDE most of the time
     65      REMOVE_LINKER_FLAGS("-INCREMENTAL:YES" Debug)
     66      ADD_LINKER_FLAGS   ("-INCREMENTAL:NO"  Debug)
     67    ENDIF()
     68  ENDIF()
     69ENDIF()
    5670
    5771######### Library Behaviour (external) ##########
     
    110124IF (DBGHELP_FOUND)
    111125  INCLUDE_DIRECTORIES(${DBGHELP_INCLUDE_DIR})
     126ENDIF()
     127
     128IF(VISUAL_LEAK_DETECTOR_ENABLE)
     129  INCLUDE_DIRECTORIES(${VLD_INCLUDE_DIR})
    112130ENDIF()
    113131
  • code/trunk/src/OrxonoxConfig.cmake

    r8409 r8412  
    8080ADD_COMPILER_FLAGS("-DCMAKE_MinSizeRel_BUILD"     MinSizeRel)
    8181
    82 IF(MSVC)
    83   # Check whether we can use Visual Leak Detector
    84   FIND_FILE(VLD_DLL vld_x86.dll)
    85   IF(VLD_DLL)
    86     SET(HAVE_VLD TRUE)
    87     OPTION(VISUAL_LEAK_DETECTOR_ENABLE "Memory leak detector" off)
    88     # Make sure the value is "on" or "off" for vld.ini
    89     IF(VISUAL_LEAK_DETECTOR_ENABLE)
    90       SET(VISUAL_LEAK_DETECTOR_ENABLE on)
    91     ELSE()
    92       SET(VISUAL_LEAK_DETECTOR_ENABLE off)
    93     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)
    98   ENDIF()
    99   MARK_AS_ADVANCED(VLD_DLL)
    100 ENDIF()
    101 
    10282############## Configured Headers ###############
    10383
Note: See TracChangeset for help on using the changeset viewer.