Skip to content

Commit fa57c0b

Browse files
author
mikeblome
committed
more version-specific sections related to copy operations
1 parent cfb4c3b commit fa57c0b

File tree

5 files changed

+54
-24
lines changed

5 files changed

+54
-24
lines changed

docs/linux/cmake-linux-project.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ For general information about CMake support in Visual Studio, see [CMake Tools f
1717

1818
First, make sure you have the **Linux development with C++** workload installed, including the CMake component. See [Install the C++ Linux workload in Visual Studio](download-install-and-setup-the-linux-development-workload.md).
1919

20-
On the Linux machine, make sure that the following are installed:
20+
On the Linux system, make sure that the following are installed:
2121

2222
- gcc
2323
- gdb
@@ -63,25 +63,29 @@ add_executable(hello-cmake hello.cpp)
6363

6464
## Choose a Linux target
6565

66-
As soon as you open the folder, Visual Studio parses the CMakeLists.txt file and specifies a Windows target of **x86-Debug**. To target Linux, change the project settings to **Linux-Debug** or **Linux-Release**.
66+
As soon as you open the folder, Visual Studio parses the CMakeLists.txt file and specifies a Windows target of **x86-Debug**. To target a remote Linux system, change the project settings to **Linux-Debug** or **Linux-Release**.
6767

6868
::: moniker range="vs-2019"
6969

70-
To target Windows Subsystem for Linux, choose **WSL-Debug**.
70+
To target Windows Subsystem for Linux, choose **WSL-Debug** or **WSL-Release** if using GCC, or the Clang variants if using the Clang/LLVM toolset.
71+
72+
**Visual Studio 2019 version 16.1** When targeting WSL, no copying or sources or headers is necessary because the compiler on Linux has direct access to the Windows file system where your source files are located, and Visual Studio likewise can access the Linux header files directly.
7173

7274
::: moniker-end
7375

74-
By default, Visual Studio chooses the first remote system in the list under **Tools** > **Options** > **Cross Platform** > **Connection Manager**. If no remote connections are found, you are prompted to create one. For more information, see [Connect to your remote Linux computer](connect-to-your-remote-linux-computer.md).
76+
For remote targets, Visual Studio by default chooses the first remote system in the list under **Tools** > **Options** > **Cross Platform** > **Connection Manager**. If no remote connections are found, you are prompted to create one. For more information, see [Connect to your remote Linux computer](connect-to-your-remote-linux-computer.md).
77+
78+
If you specify a remote Linux target, your source is copied to the remote system.
7579

76-
After you specify a Linux target, your source is copied to your Linux machine. Then, CMake is run on the Linux machine to generate the CMake cache for your project.
80+
After you select a target, CMake runs automatically on the Linux system to generate the CMake cache for your project.
7781

7882
![Generate CMake cache on Linux](media/cmake-linux-1.png "Generate the CMake cache on Linux")
7983

80-
To provide IntelliSense support for remote headers, Visual Studio automatically copies them from the Linux machine (or WSL installation) to a directory on your local Windows machine. For more information, see [IntelliSense for remote headers](configure-a-linux-project.md#remote_intellisense).
84+
To provide IntelliSense support for headers on remote Linux systems, Visual Studio automatically copies them from the Linux machine to a directory on your local Windows machine. For more information, see [IntelliSense for remote headers](configure-a-linux-project.md#remote_intellisense).
8185

8286
## Debug the project
8387

84-
To debug your code on the remote system, set a breakpoint, select the CMake target as the startup item in the toolbar menu next to the project setting, and choose **⏵ Start** on the toolbar, or press F5.
88+
To debug your code on the specified debug target system, set a breakpoint, select the CMake target as the startup item in the toolbar menu next to the project setting, and choose **⏵ Start** on the toolbar, or press F5.
8589

8690
To customize your program’s command line arguments, right-click on the executable in **Solution Explorer** and select **Debug and Launch Settings**. This opens or creates a launch.vs.json configuration file that contains information about your program. To specify additional arguments, add them in the `args` JSON array. For more information, see [Open Folder projects for C++](../build/open-folder-projects-cpp.md) and [Configure CMake debugging sessions](../build/configure-cmake-debugging-sessions.md).
8791

@@ -159,7 +163,7 @@ You can use these optional settings for more control:
159163
}
160164
```
161165

162-
These options allow you to run commands on the remote system before and after building, and before CMake generation. The values can be any command that is valid on the remote system. The output is piped back to Visual Studio.
166+
These options allow you to run commands on the Linux system before and after building, and before CMake generation. The values can be any command that is valid on the remote system. The output is piped back to Visual Studio.
163167

164168
::: moniker range="vs-2019"
165169

docs/linux/configure-a-linux-project.md

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@ ms.assetid: 4d7c6adf-54b9-4b23-bd23-5de0c825b768
77

88
This topic describes how to configure a C++ Linux project as described in [Create a new C++ Linux project in Visual Studio](create-a-new-linux-project.md). For CMake Linux projects, see [Configure a Linux CMake Project ](cmake-linux-project.md).
99

10-
You can configure a Linux project to target a physical Linux machine, a virtual machine, or the [Windows Subsystem for Linux](/windows/wsl/about).
10+
You can configure a Linux project to target a physical Linux machine, a virtual machine, or the [Windows Subsystem for Linux](/windows/wsl/about) (WSL).
1111

1212
::: moniker range="vs-2019"
1313

14-
**Visual Studio 2019 version 16.1** You can specify separate Linux targets for building and debugging.
14+
**Visual Studio 2019 version 16.1**:
15+
16+
- When targeting WSL, you can avoid the copy operations that are necessary for building and IntelliSense when targeting remote Linux systems.
17+
18+
- You can specify separate Linux targets for building and debugging.
1519

1620
::: moniker-end
1721

@@ -35,10 +39,12 @@ To change settings pertaining to the remote Linux computer, configure the remote
3539

3640
::: moniker range="vs-2019"
3741

38-
- **Visual Studio 16.1**: To target Windows Subsystem for Linux, click the down arrow for **Platform Toolset** and choose **WSL_1_0**. The other remote options will disappear and the path to the WSL shell will appear in their place:
42+
- **Visual Studio 16.1**: To target Windows Subsystem for Linux, click the down arrow for **Platform Toolset** and choose **WSL_1_0**. The other remote options will disappear and the path to the default WSL shell will appear in their place:
3943

4044
![WSL build machine](media/wsl-remote-vs2019.png)
4145

46+
If you have side-by-side WSL installations, you can specify a different path here. For example, if you have Ubuntu 18.04 installed, it is located in **C:\Users\\<username>\AppData\Local\Microsoft\WindowsApps\ubuntu1804.exe**.
47+
4248
You can specify a different target for debugging on the **Configuration Properties** > **Debugging** page.
4349

4450
::: moniker-end
@@ -50,9 +56,15 @@ To change settings pertaining to the remote Linux computer, configure the remote
5056
> [!NOTE]
5157
> To change the default C and C++ compilers, or the Linker and Archiver used to build the project, use the appropriate entries in the **C/C++ > General** section and the **Linker > General** section. You can specify a certain version of GCC or Clang, for example. For more information see [C/C++ Properties (Linux C++)](prop-pages/c-cpp-linux.md) and [Linker Properties (Linux C++)](prop-pages/linker-linux.md).
5258
53-
## Copy sources
59+
## Copy sources (remote systems only)
5460

55-
When building, the source files on your development PC are copied to the Linux computer and compiled there. By default, all sources in the Visual Studio project are copied to the locations set in the settings above. However, additional sources can also be added to the list, or copying sources can be turned off entirely, which is the default for a Makefile project.
61+
::: moniker range="vs-2019"
62+
63+
This section does not apply when targeting WSL.
64+
65+
::: moniker-end
66+
67+
When building on remote systems, the source files on your development PC are copied to the Linux computer and compiled there. By default, all sources in the Visual Studio project are copied to the locations set in the settings above. However, additional sources can also be added to the list, or copying sources can be turned off entirely, which is the default for a Makefile project.
5668

5769
- **Sources to copy** determines which sources are copied to the remote computer. By default, the **\@(SourcesToCopyRemotely)** defaults to all source code files in the project, but does not include any asset/resource files, such as images.
5870

@@ -68,7 +80,13 @@ Since all compilation is happening on a remote computer (or WSL), several additi
6880

6981
![Build Events](media/settings_buildevents.png)
7082

71-
## <a name="remote_intellisense"></a> IntelliSense for remote headers
83+
## <a name="remote_intellisense"></a> IntelliSense for headers on remote systems
84+
85+
::: moniker range="vs-2019"
86+
87+
This section does not apply when targeting WSL.
88+
89+
::: moniker-end
7290

7391
When you add a new connection in **Connection Manager**, Visual Studio automatically detects the include directories for the compiler on the remote system. Visual Studio then zips up and copies those files to a directory on your local Windows machine. After that, whenever you use that connection in a Visual Studio or CMake project, the headers in those directories are used to provide IntelliSense.
7492

docs/linux/download-install-and-setup-the-linux-development-workload.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ On Windows 10, you can install and target your favorite Linux distro on the Wind
5555
On WSL, no remote connection is required. **zip** and **rsync** are required for automatic syncing of Linux headers with Visual Studio for Intellisense support. If the required applications are not already present, you can install them as follows:
5656

5757
```bash
58-
`sudo g++ gdb make rsync zip`
58+
sudo g++ gdb make rsync zip
5959
```
6060
::: moniker-end
6161

@@ -67,14 +67,17 @@ The target Linux system must have **openssh-server**, **g++**, **gdb**, and **gd
6767

6868
1. At a shell prompt on your Linux computer, run:
6969

70-
`sudo apt-get install openssh-server g++ gdb gdbserver zip`
70+
```bash
71+
sudo apt-get install openssh-server g++ gdb gdbserver zip
72+
```
7173

7274
You may be prompted for your root password due to the sudo command. If so, enter it and continue. Once complete, the required services and tools are installed.
7375

7476
1. Ensure the ssh service is running on your Linux computer by running:
7577

76-
`sudo service ssh start`
77-
78+
```bash
79+
sudo service ssh start
80+
```
7881
This starts the service and runs it in the background, ready to accept connections.
7982

8083
::: moniker-end
@@ -85,7 +88,9 @@ The target Linux system must have **openssh-server**, **g++**, **gdb**, and **gd
8588

8689
Fedora uses the **dnf** package installer. To download **g++**, **gdb**, **rsync** and **zip**, run:
8790

88-
`sudo dnf install gcc-g++ gdb rsync zip`
91+
```bash
92+
sudo dnf install gcc-g++ gdb rsync zip
93+
```
8994

9095
**zip** and **rsync** are required for automatic syncing of Linux headers with Visual Studio for Intellisense support.
9196

@@ -99,13 +104,16 @@ The target machine running Fedora uses the **dnf** package installer. To downloa
99104

100105
1. At a shell prompt on your Linux computer, run:
101106

102-
`sudo dnf install openssh-server gcc-g++ gdb gdb-gdbserver zip`
103-
107+
```bash
108+
sudo dnf install openssh-server gcc-g++ gdb gdb-gdbserver zip
109+
```
104110
You may be prompted for your root password due to the sudo command. If so, enter it and continue. Once complete, the required services and tools are installed.
105111

106112
1. Ensure the ssh service is running on your Linux computer by running:
107113

108-
`sudo systemctl start sshd`
114+
```bash
115+
sudo systemctl start sshd
116+
```
109117

110118
This starts the service and runs it in the background, ready to accept connections.
111119

docs/linux/prop-pages/debugging-linux.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.assetid: 0c1c0fcc-a49b-451c-a5cb-ce9711fac064
77

88
Property | Description | Choices
99
--- | ---| ---
10-
Remote debug machine | **Visual Studio 2019 version 16.1**: Specifies the machine to debug the program on. Can be different than the remote build machine that is specified on the **General** page.
10+
Remote debug machine | **Visual Studio 2019 version 16.1**: Specifies the machine to debug the program on. Can be different than the remote build machine that is specified on the [General](general-linux.md) page.
1111
Pre-Launch Command | A command that is run on the shell before the debugging starts and before the debugger is running, and can be used to affect the debugging environment.
1212
Program | The full path to the program to debug on the remote system. This is a path on the remote system. If left empty or unchanged it defaults to the current project output.
1313
Program Arguments | The command line arguments to pass to the program being debugged.

docs/linux/prop-pages/general-linux.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Target Extension | Specifies a file extension that this project will generate. (
1414
Extensions to Delete on Clean | Semi-colon delimited wildcard specification for which files in the intermediate directory to delete on clean or rebuild.
1515
Build Log File | Specifies the build log file to write to when build logging is enabled.
1616
Platform Toolset | Specifies the toolset used for building the current configuration; If not set, the default toolset is used
17-
Remote Build Machine | The target machine or device to use for remote build, deploy and debug.
17+
Remote Build Machine | The target machine or device to use for remote build, deploy and debug. **Visual Studio 2019 version 16.1** A different machine for debugging can be specified in the [Debugging](debugging-linux.md) page.
1818
Remote Build Root Directory | Specifies a path to a directory on the remote machine or device.
1919
Remote Build Project Directory | Specifies a path to a directory on the remote machine or device for the project.
2020
Configuration Type | Specifies the type of output this configuration generates. | **Dynamic Library (.so)** - Dynamic Library (.so)<br>**Static library (.a)** - Static Library (.a)<br>**Application (.out)** - Application (.out)<br>**Makefile** - Makefile<br>

0 commit comments

Comments
 (0)