Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 18, 2009, 11:39:32 PM (15 years ago)
Author:
rgrieder
Message:

Improved Visual Studio IntelliSense (tool that suggests function names etc.) performance by excluding all external libraries (headers used in our projects still get parsed) and the compilations (double work otherwise).
Curiously there is no official switch to disable IntelliSense. There's only a local and unofficial version that deals with removing a particular DLL.
However if Microsoft dares to create bugs, we dare to exploit them: Specifying "-Zm1000" instead of "/Zm1000" as compile flag messes with IntelliSense. It once took me half a day to figure that out since the causality between that and "IntelliSense is not working at all for any project" is rather unexpected ;)

File:
1 edited

Legend:

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

    r5929 r5963  
    4848      ENDIF()
    4949      IF(NOT DISABLE_COMPILATIONS)
     50        SET(_compilation_file ${CMAKE_CURRENT_BINARY_DIR}/${_compilation_name})
    5051        SET(_include_string)
    5152        FOREACH(_file2 ${_compilation})
    5253          SET(_include_string "${_include_string}#include \"${_file2}\"\n")
    5354        ENDFOREACH(_file2)
    54         IF(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/${_compilation_name})
    55           FILE(READ ${CMAKE_CURRENT_BINARY_DIR}/${_compilation_name} _include_string_file)
     55        IF(EXISTS )
     56          FILE(READ ${_compilation_file} _include_string_file)
    5657        ENDIF()
    5758        IF(NOT _include_string STREQUAL "${_include_string_file}")
    58           FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${_compilation_name} "${_include_string}")
     59          FILE(WRITE ${_compilation_file} "${_include_string}")
    5960        ENDIF()
    60         LIST(APPEND _fullpath_sources ${CMAKE_CURRENT_BINARY_DIR}/${_compilation_name})
     61        LIST(APPEND _fullpath_sources ${_compilation_file})
     62        # MSVC hack that excludes the compilations from the intellisense database
     63        # (There is a bug with the "-" instead of "/". Only works for "Zm#" argument)
     64        IF(MSVC)
     65          SET_SOURCE_FILES_PROPERTIES(${_compilation_file} PROPERTIES COMPILE_FLAGS "-Zm1000")
     66        ENDIF()
    6167      ENDIF()
    6268      SET(_compilation_name)
Note: See TracChangeset for help on using the changeset viewer.