Skip to content

Commit

Permalink
VSCode new user experience
Browse files Browse the repository at this point in the history
  • Loading branch information
sturnclaw committed Sep 9, 2023
1 parent cad5570 commit b738261
Show file tree
Hide file tree
Showing 4 changed files with 344 additions and 53 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,13 @@ CMakeUserPresets.json
compile

# IDEs make their local configurations shouldn't be tracked
.vscode/
.vscode/*
.vs/
.project
.cproject
*.VC.db
*.code-workspace
!pioneer-default.code-workspace
.idea

# Core dumps shouldn't be tracked by git.
Expand Down
240 changes: 188 additions & 52 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -1,54 +1,190 @@
{
"version": 2,
"configurePresets": [
{
"name": "x64-Debug",
"displayName": "Windows x64 Debug",
"description": "Target Windows with the Visual Studio development environment.",
"generator": "Ninja",
"binaryDir": "${sourceDir}/out/build/${presetName}",
"architecture": {
"value": "x64",
"strategy": "external"
},
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}"
},
"vendor": { "microsoft.com/VisualStudioSettings/CMake/1.0": { "hostOS": [ "Windows" ] } }
},
{
"name": "x64-Release",
"displayName": "Windows x64 Release",
"description": "Target Windows with the Visual Studio development environment.",
"generator": "Ninja",
"binaryDir": "${sourceDir}/out/build/${presetName}",
"architecture": {
"value": "x64",
"strategy": "external"
},
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}"
},
"vendor": { "microsoft.com/VisualStudioSettings/CMake/1.0": { "hostOS": [ "Windows" ] } }
},
{
"name": "x64-Profiling",
"displayName": "Windows x64 Profiling",
"description": "Target Windows with the Visual Studio development environment.",
"generator": "Ninja",
"binaryDir": "${sourceDir}/out/build/${presetName}",
"architecture": {
"value": "x64",
"strategy": "external"
},
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}",
"PROFILER_ENABLED": "1"
},
"vendor": { "microsoft.com/VisualStudioSettings/CMake/1.0": { "hostOS": [ "Windows" ] } }
}
]
"version": 2,
"configurePresets": [
{
"name": "x64-Debug",
"displayName": "Windows x64 Debug",
"description": "Target Windows with the Visual Studio development environment.",
"generator": "Ninja",
"binaryDir": "${sourceDir}/out/build/${presetName}",
"architecture": {
"value": "x64",
"strategy": "external"
},
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}"
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": {
"hostOS": [
"Windows"
]
}
}
},
{
"name": "x64-Release",
"displayName": "Windows x64 Release",
"description": "Target Windows with the Visual Studio development environment.",
"generator": "Ninja",
"binaryDir": "${sourceDir}/out/build/${presetName}",
"architecture": {
"value": "x64",
"strategy": "external"
},
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}"
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": {
"hostOS": [
"Windows"
]
}
}
},
{
"name": "x64-Profiling",
"displayName": "Windows x64 Profiling",
"description": "Target Windows with the Visual Studio development environment.",
"generator": "Ninja",
"binaryDir": "${sourceDir}/out/build/${presetName}",
"architecture": {
"value": "x64",
"strategy": "external"
},
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}",
"PROFILER_ENABLED": "1"
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": {
"hostOS": [
"Windows"
]
}
}
},
{
"name": "x64-Linux-Debug",
"displayName": "Linux x64 Debug",
"description": "Use system compiler; Profiler=yes",
"binaryDir": "${sourceDir}/build/",
"generator": "Unix Makefiles",
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}",
"CMAKE_BUILD_TYPE": "Debug",
"PROFILER_ENABLED": "1"
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": {
"hostOS": [
"Linux"
]
}
}
},
{
"name": "x64-Linux-Profiler",
"displayName": "Linux x64 Profiling",
"description": "Use system compiler; Profiler=yes",
"binaryDir": "${sourceDir}/build/",
"generator": "Unix Makefiles",
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}",
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"PROFILER_ENABLED": "1"
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": {
"hostOS": [
"Linux"
]
}
}
},
{
"name": "x64-Linux-RelWithDebInfo",
"displayName": "Linux x64 Release",
"description": "Use system compiler; Profiler=no",
"binaryDir": "${sourceDir}/build/",
"generator": "Unix Makefiles",
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}",
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": {
"hostOS": [
"Linux"
]
}
}
},
{
"name": "x64-Linux-Debug-Clang",
"displayName": "Linux x64 Debug (Clang)",
"description": "CC=clang CXX=clang++; Profiler=yes",
"binaryDir": "${sourceDir}/build/",
"generator": "Unix Makefiles",
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}",
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_C_COMPILER": "/usr/bin/clang",
"CMAKE_CXX_COMPILER": "/usr/bin/clang++",
"PROFILER_ENABLED": "1"
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": {
"hostOS": [
"Linux"
]
}
}
},
{
"name": "x64-Linux-Profiler-Clang",
"displayName": "Linux x64 Profiling (Clang)",
"description": "CC=clang CXX=clang++; Profiler=yes",
"binaryDir": "${sourceDir}/build/",
"generator": "Unix Makefiles",
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}",
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"CMAKE_C_COMPILER": "/usr/bin/clang",
"CMAKE_CXX_COMPILER": "/usr/bin/clang++",
"PROFILER_ENABLED": "1"
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": {
"hostOS": [
"Linux"
]
}
}
},
{
"name": "x64-Linux-RelWithDebInfo-Clang",
"displayName": "Linux x64 Release (Clang)",
"description": "CC=clang CXX=clang++; Profiler=no",
"binaryDir": "${sourceDir}/build/",
"generator": "Unix Makefiles",
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}",
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"CMAKE_C_COMPILER": "/usr/bin/clang",
"CMAKE_CXX_COMPILER": "/usr/bin/clang++"
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": {
"hostOS": [
"Linux"
]
}
}
}
]
}
35 changes: 35 additions & 0 deletions COMPILING.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Table of Contents
=================
1 How to compile Pioneer
1.1 Linux - CMake
1.1a Linux - VSCode + CMake
1.2 Windows - MSVC
1.3 Windows - CMake and MSYS2 (and MinGW-w64)
1.4 Windows - CMake and MSVC
Expand Down Expand Up @@ -73,6 +74,40 @@ questions are welcome anytime.

4. Run `./pioneer` to start the game!

1.1a Linux - VSCode + CMake
---------

1. Install the required libraries as for '1.1 Linux - CMake'.

You'll want to install several VSCode extensions for best results:

CMake Tools (ms-vscode.cmake-tools)
C/C++ (ms-vscode.cpptools)
clangd (llvm-vs-code-extensions.vscode-clangd)
Code LLDB (vadimcn.vscode-lldb)
Lua (sumneko.lua)
Git Graph (mhutchie.git-graph)

Of these extensions, only CMake Tools is required to compile the game from
within VSCode. All other extensions help to improve the development process
if you intend on making changes to the game's files.

2. Copy ./pioneer-default.code-workspace to ./pioneer.code-workspace and
open it. This provides a quick-start workspace setup with useful workflow
defaults pre-configured. This file is ignored by Git and you can configure
the workspace to your liking from there.

3. From the bottom bar, select a configure preset for your platform. 'Release'
is recommended unless you're in the process of debugging a specific issue.
This will generate CMake files in the 'build/' folder.

4. Click the build button on the bottom toolbar, or execute the Run Build Task
command from the command pallette (Ctrl+Shift+P), selecting 'Build Pioneer'.
If all goes well, Pioneer should successfully compile.

5. Click the triangle ("launch") button in the bottom toolbar and select
'pioneer' as the active launch target.


1.2 Windows - MSVC
------------------
Expand Down
Loading

0 comments on commit b738261

Please sign in to comment.