Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*.sln.docstates
*.zip
*.code-workspace
!FlingEngine.code-workspace

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
Expand Down Expand Up @@ -300,4 +301,11 @@ CTestTestfile.cmake
_deps

## VSCode
**/.vscode
# Track our checked-in workspace config (settings/tasks/launch/extensions);
# ignore everything else VSCode writes into .vscode/ (e.g. per-user overrides, ipch).
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/cmake-variants.json
28 changes: 28 additions & 0 deletions .vscode/cmake-variants.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"buildType": {
"default": "debug",
"description": "The CMake build type",
"choices": {
"debug": {
"short": "Debug",
"long": "Full debug info, no optimizations",
"buildType": "Debug"
},
"release": {
"short": "Release",
"long": "Optimized, no debug info",
"buildType": "Release"
},
"relwithdebinfo": {
"short": "RelWithDebInfo",
"long": "Optimized, with debug info",
"buildType": "RelWithDebInfo"
},
"minsizerel": {
"short": "MinSizeRel",
"long": "Optimized for smallest size",
"buildType": "MinSizeRel"
}
}
}
}
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"ms-vscode.cmake-tools",
"ms-vscode.cpptools",
"twxs.cmake"
]
}
53 changes: 53 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug Sandbox",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/Sandbox/bin/Sandbox",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "Build Sandbox",
"windows": {
"type": "cppvsdbg",
"program": "${workspaceFolder}\\build\\Sandbox\\bin\\${command:cmake.buildType}\\Sandbox.exe"
}
},
{
"name": "Debug FlingTests",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/FlingTests/bin/FlingTests",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "Build FlingTests",
"windows": {
"type": "cppvsdbg",
"program": "${workspaceFolder}\\build\\FlingTests\\bin\\${command:cmake.buildType}\\FlingTests.exe"
}
}
]
}
9 changes: 9 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"cmake.sourceDirectory": "${workspaceFolder}",
"cmake.buildDirectory": "${workspaceFolder}/build",
"cmake.configureOnOpen": true,
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
"files.associations": {
"*.inl": "cpp"
}
}
61 changes: 61 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "CMake: Configure",
"type": "shell",
"command": "cmake",
"args": ["-S", ".", "-B", "build"],
"problemMatcher": []
},
{
"label": "Build FlingEngine",
"type": "shell",
"command": "cmake",
"args": ["--build", "build", "--target", "FlingEngine", "--config", "${command:cmake.buildType}", "--parallel"],
"group": "build",
"problemMatcher": ["$gcc", "$msCompile"]
},
{
"label": "Build Sandbox",
"type": "shell",
"command": "cmake",
"args": ["--build", "build", "--target", "Sandbox", "--config", "${command:cmake.buildType}", "--parallel"],
"group": "build",
"problemMatcher": ["$gcc", "$msCompile"]
},
{
"label": "Build FlingTests",
"type": "shell",
"command": "cmake",
"args": ["--build", "build", "--target", "FlingTests", "--config", "${command:cmake.buildType}", "--parallel"],
"group": "build",
"problemMatcher": ["$gcc", "$msCompile"]
},
{
"label": "Build All",
"type": "shell",
"command": "cmake",
"args": ["--build", "build", "--config", "${command:cmake.buildType}", "--parallel"],
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": ["$gcc", "$msCompile"]
},
{
"label": "Run FlingTests",
"type": "shell",
"command": "${workspaceFolder}/build/FlingTests/bin/FlingTests",
"windows": {
"command": "${workspaceFolder}\\build\\FlingTests\\bin\\${command:cmake.buildType}\\FlingTests.exe"
},
"dependsOn": "Build FlingTests",
"group": {
"kind": "test",
"isDefault": true
},
"problemMatcher": []
}
]
}
8 changes: 8 additions & 0 deletions FlingEngine.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"folders": [
{
"path": "."
}
],
"settings": {}
}
4 changes: 4 additions & 0 deletions Init.bat
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ git submodule update --init --recursive
:: Run cmake to generate the local x64 files in the build folder
::cd "../.."
cmake . -A x64 -B build

echo.
echo Done! Open FlingEngine.code-workspace in VS Code to build/run/debug
echo the FlingEngine, Sandbox, and FlingTests targets from the Run and Debug menu.
4 changes: 4 additions & 0 deletions Init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,7 @@ if command -v claude >/dev/null 2>&1; then
esac
fi
fi

echo
echo Done! Open FlingEngine.code-workspace in VS Code to build/run/debug
echo the FlingEngine, Sandbox, and FlingTests targets from the Run and Debug menu.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,17 @@ build\Sandbox\bin\Debug\Sandbox.exe
See [`Skills/building.md`](Skills/building.md) for switching build types (Debug/Release/
shipping) and other day-to-day build details.

### Building and debugging in VS Code

After running `Init.bat`/`Init.sh`, open [`FlingEngine.code-workspace`](FlingEngine.code-workspace)
in VS Code (install the recommended `CMake Tools` and `C/C++` extensions if prompted). The
`Run and Debug` panel has ready-made configurations — **Debug Sandbox** and **Debug FlingTests** —
that build the right target and launch it under the debugger. `Ctrl+Shift+B` builds all three
targets (`FlingEngine`, `Sandbox`, `FlingTests`); per-target build tasks are also available via
`Tasks: Run Task`. Click the build-type entry in the bottom status bar (or run `CMake: Select
Variant`) to switch between Debug, Release, RelWithDebInfo, and MinSizeRel — no need to
re-run `Init.bat`/`Init.sh`; the extension reconfigures automatically.

#### Packaging a project

For ease of development and iteration the file paths to Assets (shaders, textures, models, etc) are all
Expand Down
Loading