Skip to content

Commit 3416cc2

Browse files
committed
Major improvements for VSCode projects
- Added configurations (Win32|Win64, Release|Debug) - Passing configuration parameters to tasks.json and launch.json - Separated common configuration parameters to settings.json
1 parent def7ac9 commit 3416cc2

File tree

4 files changed

+80
-41
lines changed

4 files changed

+80
-41
lines changed

.vscode/c_cpp_properties.json

Lines changed: 26 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,32 @@
11
{
22
"configurations": [
33
{
4-
"name": "Win32",
5-
"includePath": [
6-
"${workspaceFolder}",
7-
"${workspaceFolder}/Core",
8-
"${workspaceFolder}/Unreal",
9-
"${workspaceFolder}/UmodelTool",
10-
"${workspaceFolder}/libs",
11-
"${workspaceFolder}/libs/include",
12-
"${workspaceFolder}/libs/includewin32",
13-
"${workspaceFolder}/UI"
14-
],
15-
"defines": [
16-
"MAX_DEBUG",
17-
"RENDERING",
18-
"HAS_UI"
19-
],
20-
"forcedInclude": [
21-
"${workspaceFolder}/Unreal/GameDefines.h"
22-
],
23-
"windowsSdkVersion": "10.0.18362.0",
24-
"compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe",
25-
"cStandard": "c11",
26-
"cppStandard": "c++17",
27-
"intelliSenseMode": "msvc-x64",
28-
"browse": {
29-
"path": [
30-
"${workspaceFolder}"
31-
],
32-
"limitSymbolsToIncludedHeaders": true,
33-
"databaseFilename": ""
34-
}
4+
"name": "Win32-Release",
5+
"customConfigurationVariables": {
6+
"BuildOptions": "",
7+
"ExeName": "umodel.exe"
8+
}
9+
},
10+
{
11+
"name": "Win32-Debug",
12+
"customConfigurationVariables": {
13+
"BuildOptions": "--debug",
14+
"ExeName": "umodel.exe"
15+
}
16+
},
17+
{
18+
"name": "Win64-Release",
19+
"customConfigurationVariables": {
20+
"BuildOptions": "--64",
21+
"ExeName": "umodel.exe"
22+
}
23+
},
24+
{
25+
"name": "Win64-Debug",
26+
"customConfigurationVariables": {
27+
"BuildOptions": "--64 --debug",
28+
"ExeName": "umodel.exe"
29+
}
3530
}
3631
],
3732
"version": 4

.vscode/launch.json

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"name": "(No arguments)",
1010
"type": "cppvsdbg",
1111
"request": "launch",
12-
"program": "${workspaceFolder}/umodel.exe",
12+
"program": "${workspaceFolder}/${input:ExeName}",
1313
"args": [],
1414
"stopAtEntry": false,
1515
"cwd": "${workspaceFolder}",
@@ -21,7 +21,7 @@
2121
"name": "Volatile (cmdline.cfg)",
2222
"type": "cppvsdbg",
2323
"request": "launch",
24-
"program": "${workspaceFolder}/umodel.exe",
24+
"program": "${workspaceFolder}/${input:ExeName}",
2525
"args": [ "@${workspaceFolder}/docs/cmdline.cfg" ],
2626
"cwd": "${workspaceFolder}",
2727
"logging": { "moduleLoad": false },
@@ -38,5 +38,15 @@
3838
"logging": { "moduleLoad": false },
3939
"visualizerFile": "${workspaceFolder}/Tools/umodel.natvis"
4040
}
41-
]
42-
}
41+
],
42+
"inputs": [
43+
// Requesting a customConfigurationVariables from c_cpp_properties.json (undocumented, may be changed in a future_
44+
// https://stackoverflow.com/a/62404215
45+
{
46+
"id": "ExeName",
47+
"type": "command",
48+
"command": "cpptools.activeConfigCustomVariable",
49+
"args": "ExeName"
50+
}
51+
]
52+
}

.vscode/settings.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,32 @@
2525
"*.project": "perl"
2626
},
2727
"files.trimTrailingWhitespace": true,
28+
"C_Cpp.default.includePath": [
29+
"${workspaceFolder}",
30+
"${workspaceFolder}/Core",
31+
"${workspaceFolder}/Unreal",
32+
"${workspaceFolder}/UmodelTool",
33+
"${workspaceFolder}/libs",
34+
"${workspaceFolder}/libs/include",
35+
"${workspaceFolder}/libs/includewin32",
36+
"${workspaceFolder}/UI"
37+
],
38+
"C_Cpp.default.defines": [
39+
"MAX_DEBUG",
40+
"RENDERING",
41+
"HAS_UI"
42+
],
43+
"C_Cpp.default.forcedInclude": [
44+
"${workspaceFolder}/Unreal/GameDefines.h"
45+
],
46+
"C_Cpp.default.cStandard": "c11",
47+
"C_Cpp.default.cppStandard": "c++17",
48+
"C_Cpp.default.intelliSenseMode": "msvc-x64",
49+
"C_Cpp.default.browse.path": [
50+
"${workspaceFolder}"
51+
],
52+
"C_Cpp.default.browse.limitSymbolsToIncludedHeaders": true,
53+
"C_Cpp.default.browse.databaseFilename": "",
2854
"cSpell.words": [
2955
"FCOLOR",
3056
"FGPU",

.vscode/tasks.json

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
{
77
"label": "Build",
88
"type": "shell",
9-
"command": "./build.sh --debug",
9+
"command": "./build.sh ${input:BuildOptions}",
1010
"group": {
1111
"kind": "build",
1212
"isDefault": true
@@ -21,7 +21,7 @@
2121
{
2222
"label": "Compile",
2323
"type": "shell",
24-
"command": "./build.sh --debug --file \"${relativeFile}\"",
24+
"command": "./build.sh ${input:BuildOptions} --file \"${relativeFile}\"",
2525
"presentation": {
2626
"reveal": "always",
2727
"showReuseMessage": false,
@@ -57,13 +57,21 @@
5757
},
5858
"problemMatcher": ""
5959
}
60-
]
60+
],
6161
"inputs": [
62+
// Requesting a customConfigurationVariables from c_cpp_properties.json (undocumented, may be changed in a future_
63+
// https://stackoverflow.com/a/62404215
64+
{
65+
"id": "BuildOptions",
66+
"type": "command",
67+
"command": "cpptools.activeConfigCustomVariable",
68+
"args": "BuildOptions"
69+
},
6270
{
6371
"id": "ue4const",
72+
"type": "promptString",
6473
"description": "UE4 C++ constant:",
65-
"default": "",
66-
"type": "promptString"
74+
"default": ""
6775
},
68-
]
76+
]
6977
}

0 commit comments

Comments
 (0)