Add instructions and files for building inside Visual Studio Code (Windows) (#86347)
* Add instructions for VSCode * Update to instructions * More instructions updates * Instruciton capitalization fix * Move build configs to a workspace file * Add code-workspace and don't ingore it
This commit is contained in:
@@ -61,6 +61,7 @@ zzip
|
||||
|
||||
# Visual Studio files
|
||||
*.code-workspace
|
||||
!Cataclysm-DDA.code-workspace
|
||||
*.exp
|
||||
*.ilk
|
||||
*.opensdf
|
||||
@@ -81,6 +82,7 @@ Directory.Build.targets
|
||||
.vscode/**
|
||||
!.vscode/settings.json
|
||||
!.vscode/extensions.json
|
||||
!.vscode/msbuild.ps1
|
||||
|
||||
# Visual Studio project files
|
||||
/msvc-full-features/**/
|
||||
|
||||
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
param(
|
||||
[Parameter(Mandatory)][string]$SolutionPath,
|
||||
[Parameter(Mandatory)][string]$Configuration,
|
||||
[string]$Platform = 'x64'
|
||||
)
|
||||
|
||||
$pf86 = [System.Environment]::GetEnvironmentVariable('ProgramFiles(x86)')
|
||||
$vswhere = Join-Path $pf86 'Microsoft Visual Studio\Installer\vswhere.exe'
|
||||
$msbuild = & $vswhere -latest -requires Microsoft.Component.MSBuild -find 'MSBuild\**\Bin\MSBuild.exe' |
|
||||
Select-Object -Last 1
|
||||
|
||||
if (-not $msbuild) {
|
||||
Write-Error 'MSBuild not found. Is Visual Studio installed?'
|
||||
exit 1
|
||||
}
|
||||
|
||||
& $msbuild $SolutionPath /p:Configuration=$Configuration /p:Platform=$Platform /m
|
||||
exit $LASTEXITCODE
|
||||
@@ -0,0 +1,92 @@
|
||||
{
|
||||
"folders": [
|
||||
{
|
||||
"path": "."
|
||||
}
|
||||
],
|
||||
"tasks": {
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "MSBuild: Debug|x64",
|
||||
"type": "shell",
|
||||
"command": "${workspaceFolder}\\.vscode\\msbuild.ps1",
|
||||
"args": ["-SolutionPath", "${workspaceFolder}\\msvc-full-features\\Cataclysm-vcpkg-static.sln", "-Configuration", "Debug"],
|
||||
"group": "build",
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "MSBuild: Debug|x86",
|
||||
"type": "shell",
|
||||
"command": "${workspaceFolder}\\.vscode\\msbuild.ps1",
|
||||
"args": ["-SolutionPath", "${workspaceFolder}\\msvc-full-features\\Cataclysm-vcpkg-static.sln", "-Configuration", "Debug", "-Platform", "x86"],
|
||||
"group": "build",
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "MSBuild: Quick|x64",
|
||||
"type": "shell",
|
||||
"command": "${workspaceFolder}\\.vscode\\msbuild.ps1",
|
||||
"args": ["-SolutionPath", "${workspaceFolder}\\msvc-full-features\\Cataclysm-vcpkg-static.sln", "-Configuration", "Quick"],
|
||||
"group": "build",
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "MSBuild: Quick|x86",
|
||||
"type": "shell",
|
||||
"command": "${workspaceFolder}\\.vscode\\msbuild.ps1",
|
||||
"args": ["-SolutionPath", "${workspaceFolder}\\msvc-full-features\\Cataclysm-vcpkg-static.sln", "-Configuration", "Quick", "-Platform", "x86"],
|
||||
"group": "build",
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "MSBuild: Release|x64",
|
||||
"type": "shell",
|
||||
"command": "${workspaceFolder}\\.vscode\\msbuild.ps1",
|
||||
"args": ["-SolutionPath", "${workspaceFolder}\\msvc-full-features\\Cataclysm-vcpkg-static.sln", "-Configuration", "Release"],
|
||||
"group": "build",
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "MSBuild: Release|x86",
|
||||
"type": "shell",
|
||||
"command": "${workspaceFolder}\\.vscode\\msbuild.ps1",
|
||||
"args": ["-SolutionPath", "${workspaceFolder}\\msvc-full-features\\Cataclysm-vcpkg-static.sln", "-Configuration", "Release", "-Platform", "x86"],
|
||||
"group": "build",
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "MSBuild: Debug-NoTiles|x64",
|
||||
"type": "shell",
|
||||
"command": "${workspaceFolder}\\.vscode\\msbuild.ps1",
|
||||
"args": ["-SolutionPath", "${workspaceFolder}\\msvc-full-features\\Cataclysm-vcpkg-static.sln", "-Configuration", "Debug-NoTiles"],
|
||||
"group": "build",
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "MSBuild: Debug-NoTiles|x86",
|
||||
"type": "shell",
|
||||
"command": "${workspaceFolder}\\.vscode\\msbuild.ps1",
|
||||
"args": ["-SolutionPath", "${workspaceFolder}\\msvc-full-features\\Cataclysm-vcpkg-static.sln", "-Configuration", "Debug-NoTiles", "-Platform", "x86"],
|
||||
"group": "build",
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "MSBuild: Release-NoTiles|x64",
|
||||
"type": "shell",
|
||||
"command": "${workspaceFolder}\\.vscode\\msbuild.ps1",
|
||||
"args": ["-SolutionPath", "${workspaceFolder}\\msvc-full-features\\Cataclysm-vcpkg-static.sln", "-Configuration", "Release-NoTiles"],
|
||||
"group": "build",
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "MSBuild: Release-NoTiles|x86",
|
||||
"type": "shell",
|
||||
"command": "${workspaceFolder}\\.vscode\\msbuild.ps1",
|
||||
"args": ["-SolutionPath", "${workspaceFolder}\\msvc-full-features\\Cataclysm-vcpkg-static.sln", "-Configuration", "Release-NoTiles", "-Platform", "x86"],
|
||||
"group": "build",
|
||||
"problemMatcher": "$msCompile"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
+18
-1
@@ -21,6 +21,7 @@
|
||||
* [Troubleshooting](#mac-os-x-troubleshooting)
|
||||
* [Windows](#windows)
|
||||
* [Building with Visual Studio](#building-with-visual-studio)
|
||||
* [Building with Visual Studio Code (MSBuild)](#building-with-visual-studio-code-msbuild)
|
||||
* [Building with MSYS2](#building-with-msys2)
|
||||
* [Building with CYGWIN](#building-with-cygwin)
|
||||
* [Building with Clang and MinGW64](#building-with-clang-and-mingw64)
|
||||
@@ -263,7 +264,7 @@ Installation
|
||||
sudo apt install astyle autoconf automake autopoint bash bison bzip2 cmake flex gettext git g++ gperf intltool libffi-dev libgdk-pixbuf2.0-dev libtool libltdl-dev libssl-dev libxml-parser-perl lzip make mingw-w64 openssl p7zip-full patch perl pkg-config python3 ruby scons sed unzip wget xz-utils g++-multilib libc6-dev-i386 libtool-bin
|
||||
mkdir -p ~/src/libbacktrace
|
||||
cd ~/src
|
||||
git clone https://github.com/CleverRaven/Cataclysm-DDA.git
|
||||
git clone https://github.com/CleverRaven/Cataclysm-DDA.git
|
||||
git clone https://github.com/mxe/mxe.git
|
||||
cd mxe
|
||||
make -j$((`nproc`+0)) MXE_TARGETS='x86_64-w64-mingw32.static i686-w64-mingw32.static' MXE_PLUGIN_DIRS=plugins/gcc11 sdl2 sdl2_ttf sdl2_image sdl2_mixer gettext
|
||||
@@ -652,6 +653,22 @@ This is probably the easiest solution for someone used to working with Visual St
|
||||
|
||||
For an alternative setup using [CMake](../../CMakeLists.txt), please read [COMPILING-CMAKE-VCPKG.md](COMPILING-CMAKE-VCPKG.md).
|
||||
|
||||
## Building with Visual Studio Code (MSBuild)
|
||||
|
||||
This method uses Visual Studio's MSBuild toolchain without needing to open Visual Studio itself.
|
||||
|
||||
### Setup
|
||||
|
||||
Follow the instructions in the [Building with Visual Studio](#building-with-visual-studio) section.
|
||||
|
||||
### Running a build
|
||||
|
||||
1. Open the repository using the `Cataclysm-DDA.code-workspace` file in VS Code. Opening the bare folder is not sufficient, as the workspace file configures the build tasks and settings.
|
||||
2. Press **Ctrl+Shift+B** (or go to **Terminal → Run Build Task**) to open the build task picker.
|
||||
3. Select the desired configuration.
|
||||
|
||||
Build output and errors will appear in the **Terminal** panel.
|
||||
|
||||
## Building with MSYS2
|
||||
|
||||
See [COMPILING-MSYS.md](COMPILING-MSYS.md) for instructions on how to set up and use a build environment using MSYS2 on windows.
|
||||
|
||||
Reference in New Issue
Block a user