Skip to content

VS Code config files for C++ development and debugging Linux

Notifications You must be signed in to change notification settings

mkilivan/vscode-cpp-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VS Code C++ Config

This is a template C++ project for VS Code.

To install dependencies the following tools are recomended:

Dependencies

  • gcc 7+

    Install command
    • Debian/Ubuntu:

        sudo apt install build-essential
      
    • Windows:

        choco install mingw -y
      
    • MacOS:

        brew install gcc
      
  • clang 6+

    Install command
    • Debian/Ubuntu:

        bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
      
    • Windows:

      Visual Studio 2019 ships with LLVM (see the Visual Studio section). However, to install LLVM separately:

        choco install llvm -y
      

      llvm-utils for using external LLVM with Visual Studio generator:

        git clone https://github.com/zufuliu/llvm-utils.git
        cd llvm-utils/VS2017
        .\install.bat
      
    • MacOS:

        brew install llvm
      
  • CMake 3.15+

    Install Command
    • Debian/Ubuntu:

        sudo apt-get install cmake
      
    • Windows:

        choco install cmake -y --installargs 'ADD_CMAKE_TO_PATH=""User""'
      
    • MacOS:

        brew install cmake
      

Optional Dependencies

  • Doxygen

    Install Command
    • Debian/Ubuntu:

        sudo apt-get install doxygen
        sudo apt-get install graphviz
      
    • Windows:

        choco install doxygen.install -y
        choco install graphviz -y
      
    • MacOS:

        brew install doxygen
        brew install graphviz
      
  • Cppcheck

    Install Command
    • Debian/Ubuntu:

        sudo apt-get install cppcheck
      
    • Windows:

        choco install cppcheck -y
      
    • MacOS:

        brew install cppcheck
      

VS Code extentions

Extention Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter
C/C++ ext install ms-vscode.cpptools
CMake Tools ext install ms-vscode.cpptools
C/C++ Advanced Lint ext install jbenden.c-cpp-flylint

Available VS Code commands (CTRL-P)

Task Keybinding
CMake: Run Without Debugging Shift+F5
CMake: Build F7
Debug: Start Debugging F5

General CMake Options

CMake options are variables that can either be ON or OFF, with a controllable default. You can set an option either with CMake Gui tools or the command line via -D.

ENABLE_DOXYGEN

(Defaults to OFF) If enabled, the Doxygen documents will be built.

ENABLE_CPPCHECK

(Defaults to OFF) Enable static analysis with cppcheck

ENABLE_CLANG_TIDY

(Defaults to OFF) Enable static analysis with clang-tidy

About

VS Code config files for C++ development and debugging Linux

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published