Skip to content

Commit 498c0ca

Browse files
authored
Merge pull request #507 from cortex-command-community/vscode-debugging
Add VS Code debug and build configurations
2 parents 38cf361 + 810c05b commit 498c0ca

File tree

216 files changed

+3907
-145
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

216 files changed

+3907
-145
lines changed

.vscode/launch.json

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "meson Launch",
9+
"type": "cppdbg",
10+
"osx": {
11+
"MIMode": "lldb"
12+
},
13+
"request": "launch",
14+
"program": "${workspaceFolder}/${config:mesonbuild.buildFolder}/CortexCommand",
15+
"cwd": "${workspaceFolder}/../Cortex-Command-Community-Project-Data",
16+
"preLaunchTask": "meson Build Release",
17+
"envFile": "${workspaceFolder}/${config:mesonbuild.buildFolder}/meson-vscode.env",
18+
"presentation": {
19+
"group": "unix"
20+
}
21+
},
22+
{
23+
"name": "meson Debug (Release)",
24+
"type": "cppdbg",
25+
"osx": {
26+
"MIMode": "lldb"
27+
},
28+
"request": "launch",
29+
"program": "${workspaceFolder}/${config:mesonbuild.buildFolder}/CortexCommand_debug",
30+
"cwd": "${workspaceFolder}/../Cortex-Command-Community-Project-Data",
31+
"preLaunchTask": "meson Build Debug (Release)",
32+
"envFile": "${workspaceFolder}/${config:mesonbuild.buildFolder}/meson-vscode.env",
33+
"presentation": {
34+
"group": "unix"
35+
}
36+
},
37+
{
38+
"name": "meson Debug (Minimal)",
39+
"type": "cppdbg",
40+
"osx": {
41+
"MIMode": "lldb"
42+
},
43+
"request": "launch",
44+
"program": "${workspaceFolder}/${config:mesonbuild.buildFolder}/CortexCommand_debug",
45+
"cwd": "${workspaceFolder}/../Cortex-Command-Community-Project-Data",
46+
"preLaunchTask": "meson Build Debug (Minimal)",
47+
"envFile": "${workspaceFolder}/${config:mesonbuild.buildFolder}/meson-vscode.env",
48+
"presentation": {
49+
"group": "unix"
50+
}
51+
},
52+
{
53+
"name": "meson Debug (Full)",
54+
"type": "cppdbg",
55+
"osx": {
56+
"MIMode": "lldb"
57+
},
58+
"request": "launch",
59+
"program": "${workspaceFolder}/${config:mesonbuild.buildFolder}/CortexCommand_debug",
60+
"cwd": "${workspaceFolder}/../Cortex-Command-Community-Project-Data",
61+
"preLaunchTask": "meson Build Debug (Full)",
62+
"envFile": "${workspaceFolder}/${config:mesonbuild.buildFolder}/meson-vscode.env",
63+
"presentation": {
64+
"group": "unix"
65+
}
66+
},
67+
68+
{
69+
"name": "msbuild Launch",
70+
"type": "cppvsdbg",
71+
"request": "launch",
72+
"program": "${workspaceFolder}/../Cortex-Command-Community-Project-Data/Cortex Command.exe",
73+
"cwd": "${workspaceFolder}/../Cortex-Command-Community-Project-Data",
74+
"preLaunchTask": "msbuild (Final)",
75+
"presentation": {
76+
"group": "windows"
77+
}
78+
},
79+
{
80+
"name": "msbuild Debug (Release)",
81+
"type": "cppvsdbg",
82+
"request": "launch",
83+
"program": "${workspaceFolder}/../Cortex-Command-Community-Project-Data/Cortex Command.debug.release.exe",
84+
"cwd": "${workspaceFolder}/../Cortex-Command-Community-Project-Data",
85+
"preLaunchTask": "msbuild (Debug Release)",
86+
"presentation": {
87+
"group": "windows"
88+
}
89+
},
90+
{
91+
"name": "msbuild Debug (Minimal)",
92+
"type": "cppvsdbg",
93+
"request": "launch",
94+
"program": "${workspaceFolder}/../Cortex-Command-Community-Project-Data/Cortex Command.debug.minimal.exe",
95+
"cwd": "${workspaceFolder}/../Cortex-Command-Community-Project-Data",
96+
"preLaunchTask": "msbuild (Debug Minimal)",
97+
"presentation": {
98+
"group": "windows"
99+
}
100+
},
101+
{
102+
"name": "msbuild Debug (Full)",
103+
"type": "cppvsdbg",
104+
"request": "launch",
105+
"program": "${workspaceFolder}/../Cortex-Command-Community-Project-Data/Cortex Command.debug.full.exe",
106+
"cwd": "${workspaceFolder}/../Cortex-Command-Community-Project-Data",
107+
"preLaunchTask": "msbuild (Debug Full)",
108+
"presentation": {
109+
"group": "windows"
110+
}
111+
},
112+
113+
{
114+
"name": "meson Launch [Windows]",
115+
"type": "cppvsdbg",
116+
"request": "launch",
117+
"program": "${workspaceFolder}/${config:mesonbuild.buildFolder}/Cortex Command.exe",
118+
"cwd": "${workspaceFolder}/../Cortex-Command-Community-Project-Data",
119+
"preLaunchTask": "meson Build Release",
120+
"envFile": "${workspaceFolder}/${config:mesonbuild.buildFolder}/meson-vscode.env",
121+
"presentation": {
122+
"group": "windows"
123+
}
124+
},
125+
{
126+
"name": "meson Debug (Release) [Windows]",
127+
"type": "cppvsdbg",
128+
"request": "launch",
129+
"program": "${workspaceFolder}/${config:mesonbuild.buildFolder}/Cortex Command.debug.release.exe",
130+
"cwd": "${workspaceFolder}/../Cortex-Command-Community-Project-Data",
131+
"preLaunchTask": "meson Build Debug (Release)",
132+
"envFile": "${workspaceFolder}/${config:mesonbuild.buildFolder}/meson-vscode.env",
133+
"presentation": {
134+
"group": "windows"
135+
}
136+
},
137+
{
138+
"name": "meson Debug (Minimal) [Windows]",
139+
"type": "cppvsdbg",
140+
"request": "launch",
141+
"program": "${workspaceFolder}/${config:mesonbuild.buildFolder}/Cortex Command.debug.minimal.exe",
142+
"cwd": "${workspaceFolder}/../Cortex-Command-Community-Project-Data",
143+
"preLaunchTask": "meson Build Debug (Minimal)",
144+
"envFile": "${workspaceFolder}/${config:mesonbuild.buildFolder}/meson-vscode.env",
145+
"presentation": {
146+
"group": "windows"
147+
}
148+
},
149+
{
150+
"name": "meson Debug (Full) [Windows]",
151+
"type": "cppvsdbg",
152+
"request": "launch",
153+
"program": "${workspaceFolder}/${config:mesonbuild.buildFolder}/Cortex Command.debug.full.exe",
154+
"cwd": "${workspaceFolder}/../Cortex-Command-Community-Project-Data",
155+
"preLaunchTask": "meson Build Debug (Full)",
156+
"envFile": "${workspaceFolder}/${config:mesonbuild.buildFolder}/meson-vscode.env",
157+
"presentation": {
158+
"group": "windows"
159+
}
160+
}
161+
]
162+
}

.vscode/tasks.json

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "meson Build Release",
6+
"dependsOn": ["Configure Release", "Meson: Build all targets"],
7+
"dependsOrder": "sequence"
8+
},
9+
{
10+
"label": "meson Build Debug (Release)",
11+
"dependsOn": ["Configure Debug (Release)", "Meson: Build all targets"],
12+
"dependsOrder": "sequence"
13+
},
14+
{
15+
"label": "meson Build Debug (Minimal)",
16+
"dependsOn": ["Configure Debug (Minimal)", "Meson: Build all targets"],
17+
"dependsOrder": "sequence"
18+
},
19+
{
20+
"label": "meson Build Debug (Full)",
21+
"dependsOn": ["Configure Debug (Full)", "Meson: Build all targets"],
22+
"dependsOrder": "sequence"
23+
},
24+
{
25+
"label": "Setup Meson",
26+
"type": "process",
27+
"problemMatcher": ["$meson-gcc"],
28+
"command": "meson",
29+
"args": ["setup", "${config:mesonbuild.buildFolder}"],
30+
"windows": {
31+
"args": ["setup", "${config:mesonbuild.buildFolder}", "--vsenv"]
32+
},
33+
"osx": {
34+
"options": {
35+
"env": {
36+
"CC": "gcc-12",
37+
"CXX": "g++-12",
38+
"CXX_LD": "g++-12"
39+
}
40+
}
41+
}
42+
},
43+
{
44+
"label": "Configure Debug (Release)",
45+
"type": "process",
46+
"problemMatcher": ["$meson-gcc"],
47+
"command": "meson",
48+
"hide": true,
49+
"args": [
50+
"configure",
51+
"--buildtype=debug",
52+
"-Ddebug_type=release",
53+
"-Db_lto=false",
54+
"${config:mesonbuild.buildFolder}"
55+
],
56+
"windows": {
57+
"args": [
58+
"configure",
59+
"--buildtype=debug",
60+
"-Ddebug_type=release",
61+
"${config:mesonbuild.buildFolder}"
62+
]
63+
}
64+
},
65+
{
66+
"label": "Configure Debug (Minimal)",
67+
"type": "process",
68+
"problemMatcher": ["$meson-gcc"],
69+
"command": "meson",
70+
"hide": true,
71+
"args": [
72+
"configure",
73+
"--buildtype=debug",
74+
"-Ddebug_type=minimal",
75+
"-Db_lto=false",
76+
"${config:mesonbuild.buildFolder}"
77+
],
78+
"windows": {
79+
"args": [
80+
"configure",
81+
"--buildtype=debug",
82+
"-Ddebug_type=minimal",
83+
"${config:mesonbuild.buildFolder}"
84+
]
85+
}
86+
},
87+
{
88+
"label": "Configure Debug (Full)",
89+
"type": "process",
90+
"problemMatcher": ["$meson-gcc"],
91+
"command": "meson",
92+
"hide": true,
93+
"args": [
94+
"configure",
95+
"--buildtype=debug",
96+
"-Ddebug_type=full",
97+
"-Db_lto=false",
98+
"${config:mesonbuild.buildFolder}"
99+
],
100+
"windows": {
101+
"args": [
102+
"configure",
103+
"--buildtype=debug",
104+
"-Ddebug_type=full",
105+
"${config:mesonbuild.buildFolder}"
106+
]
107+
}
108+
},
109+
{
110+
"label": "Configure Release",
111+
"type": "process",
112+
"problemMatcher": ["$meson-gcc"],
113+
"command": "meson",
114+
"hide": true,
115+
"args": [
116+
"configure",
117+
"--buildtype=release",
118+
"-Ddebug_type=release",
119+
"-Db_lto=true",
120+
"${config:mesonbuild.buildFolder}"
121+
],
122+
"windows": {
123+
"args": [
124+
"configure",
125+
"--buildtype=release",
126+
"${config:mesonbuild.buildFolder}"
127+
]
128+
}
129+
},
130+
{
131+
"type": "meson",
132+
"hide": true,
133+
"mode": "build",
134+
"problemMatcher": ["$meson-gcc"],
135+
"group": "build"
136+
},
137+
{
138+
"label": "msbuild (Final)",
139+
"type": "process",
140+
"command": "msbuild",
141+
"args": ["/m", "/p:Configuration=Final", "RTEA.sln"]
142+
},
143+
{
144+
"label": "msbuild (Debug Release)",
145+
"type": "process",
146+
"command": "msbuild",
147+
"args": ["/m", "/p:Configuration=Debug Release", "RTEA.sln"]
148+
},
149+
{
150+
"label": "msbuild (Debug Minimal)",
151+
"type": "process",
152+
"command": "msbuild",
153+
"args": ["/m", "/p:Configuration=Debug Minimal", "RTEA.sln"]
154+
},
155+
{
156+
"label": "msbuild (Debug Full)",
157+
"type": "process",
158+
"command": "msbuild",
159+
"args": ["/m", "/p:Configuration=Debug Full", "RTEA.sln"]
160+
}
161+
]
162+
}

Lua/meson.build

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
sources += files(
1+
lua_sources = files(
22
'LuabindObjectWrapper.cpp',
33
'LuaAdapters.cpp',
44
'LuaBindingsActivities.cpp',
@@ -10,3 +10,17 @@ sources += files(
1010
'LuaBindingsSystem.cpp',
1111
'LuaBindingsPrimitives.cpp'
1212
)
13+
14+
luabindings_cpp_args = []
15+
defaults_override = []
16+
if compiler.get_argument_syntax() == 'gcc'
17+
elif compiler.get_argument_syntax() == 'msvc'
18+
luabindings_cpp_args += ['-D_HAS_ITERATOR_DEBUGGING=0', '-D_HAS_AUTO_PTR_ETC=1', '-permissive', '-bigobj']
19+
defaults_override = ['cpp_std=v'+get_option('cpp_std')] # override standard to use vc++, removing permissive- flag
20+
message(defaults_override)
21+
else
22+
error('Unsupported compiler')
23+
endif
24+
25+
lua_bindings = static_library('lua_bindings', lua_sources, dependencies:deps + luabind_dep, include_directories: [source_inc_dirs, external_inc_dirs], cpp_args: luabindings_cpp_args, cpp_pch:pch, override_options: defaults_override)
26+
source_libs += lua_bindings

Managers/meson.build

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
sources += files(
2-
'AchievementMan.cpp',
2+
#'AchievementMan.cpp',
33
'ActivityMan.cpp',
44
'AudioMan.cpp',
55
'CameraMan.cpp',
66
'ConsoleMan.cpp',
77
'FrameMan.cpp',
8-
'LuaMan.cpp',
8+
#'LuaMan.cpp',
99
'MenuMan.cpp',
1010
'MetaMan.cpp',
1111
'MovableMan.cpp',
@@ -21,3 +21,17 @@ sources += files(
2121
'UInputMan.cpp',
2222
'WindowMan.cpp'
2323
)
24+
luaman_cpp_args = []
25+
defaults_override = []
26+
if compiler.get_argument_syntax() == 'gcc'
27+
luaman_cpp_args += ['-fpermissive']
28+
elif compiler.get_argument_syntax() == 'msvc'
29+
luaman_cpp_args += ['-D_HAS_ITERATOR_DEBUGGING=0', '-D_HAS_AUTO_PTR_ETC=1', '-permissive', '-bigobj']
30+
defaults_override = ['cpp_std=v'+get_option('cpp_std')] # override standard to use vc++, removing permissive- flag
31+
message(defaults_override)
32+
else
33+
error('Unsupported compiler')
34+
endif
35+
36+
luaman = static_library('LuaMan', 'LuaMan.cpp', dependencies:deps + luabind_dep, include_directories: [source_inc_dirs, external_inc_dirs], cpp_args: luaman_cpp_args, cpp_pch:pch, override_options: defaults_override)
37+
source_libs += luaman

0 commit comments

Comments
 (0)