From 5454456cb3ee5d89740810a0af1b9402e3c1e5cb Mon Sep 17 00:00:00 2001 From: Andrew Udvare Date: Mon, 5 Oct 2020 04:57:21 -0400 Subject: [PATCH 1/5] VS Code settings for code and debugging (Linux x64 only) --- .vscode/launch.json | 26 ++++++++++++++++++++++++++ .vscode/settings.json | 16 ++++++++++++++++ .vscode/tasks.json | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 .vscode/launch.json create mode 100644 .vscode/settings.json create mode 100644 .vscode/tasks.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..92b8df0d --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,26 @@ +{ + "configurations": [ + { + "MIMode": "gdb", + "args": [], + "cwd": "${workspaceFolder}", + "environment": [], + "externalConsole": false, + "name": "(gdb) Launch", + "preLaunchTask": "Compile (Linux x64)", + "program": "${workspaceFolder}/bin/linux-amd64-librw_gl3_glfw-oal/Debug/re3", + "request": "launch", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "ignoreFailures": true, + "text": "-enable-pretty-printing" + } + ], + "stopAtEntry": false, + "targetArchitecture": "x64", + "type": "cppdbg" + } + ], + "version": "0.2.0" +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..d37e8ae8 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,16 @@ +{ + "C_Cpp.default.cStandard": "gnu11", + "C_Cpp.default.cppStandard": "gnu++14", + "C_Cpp.default.includePath": [ + "src/fakerw", + "src/math", + "src/render", + "src/skel", + "vendor/librw" + ], + "C_Cpp.vcFormat.indent.gotoLabels": "leftmostColumn", + "C_Cpp.vcFormat.space.pointerReferenceAlignment": "right", + "cSpell.enabled": false, + "files.trimFinalNewlines": false, + "files.trimTrailingWhitespace": false +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 00000000..475c805e --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,39 @@ +{ + "inputs": [ + { + "default": "5", + "description": "Number of jobs to run simultaneously when compiling", + "id": "numberOfJobs", + "type": "promptString" + } + ], + "tasks": [ + { + "args": ["--with-librw", "gmake2"], + "command": "./premake5Linux", + "label": "Premake (Linux)", + "problemMatcher": "$gcc", + "type": "shell" + }, + { + "args": [ + "-j${input:numberOfJobs}", + "config=debug_linux-amd64-librw_gl3_glfw-oal", + "verbose=1" + ], + "command": "make", + "dependsOn": "Premake (Linux)", + "group": { + "isDefault": true, + "kind": "build" + }, + "label": "Compile (Linux x64)", + "options": { + "cwd": "${workspaceFolder}/build" + }, + "problemMatcher": "$gcc", + "type": "shell" + } + ], + "version": "2.0.0" +} From 324f84750bbe58fb0d8b05da07bce78a7d88b08d Mon Sep 17 00:00:00 2001 From: Andrew Udvare Date: Thu, 8 Oct 2020 23:14:37 -0400 Subject: [PATCH 2/5] vscode: Linux: add release configurations --- .vscode/launch.json | 25 +++++++++++++++++++++++-- .vscode/tasks.json | 31 +++++++++++++++++++++---------- 2 files changed, 44 insertions(+), 12 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 92b8df0d..a98dfa3f 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -6,8 +6,8 @@ "cwd": "${workspaceFolder}", "environment": [], "externalConsole": false, - "name": "(gdb) Launch", - "preLaunchTask": "Compile (Linux x64)", + "name": "(gdb) Launch (Debug)", + "preLaunchTask": "Compile (Debug Linux x64)", "program": "${workspaceFolder}/bin/linux-amd64-librw_gl3_glfw-oal/Debug/re3", "request": "launch", "setupCommands": [ @@ -20,6 +20,27 @@ "stopAtEntry": false, "targetArchitecture": "x64", "type": "cppdbg" + }, + { + "MIMode": "gdb", + "args": [], + "cwd": "${workspaceFolder}", + "environment": [], + "externalConsole": false, + "name": "(gdb) Launch (Release)", + "preLaunchTask": "Compile (Release Linux x64)", + "program": "${workspaceFolder}/bin/linux-amd64-librw_gl3_glfw-oal/Release/re3", + "request": "launch", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "ignoreFailures": true, + "text": "-enable-pretty-printing" + } + ], + "stopAtEntry": false, + "targetArchitecture": "x64", + "type": "cppdbg" } ], "version": "0.2.0" diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 475c805e..c4fdc285 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,12 +1,4 @@ { - "inputs": [ - { - "default": "5", - "description": "Number of jobs to run simultaneously when compiling", - "id": "numberOfJobs", - "type": "promptString" - } - ], "tasks": [ { "args": ["--with-librw", "gmake2"], @@ -17,7 +9,7 @@ }, { "args": [ - "-j${input:numberOfJobs}", + "-j5", "config=debug_linux-amd64-librw_gl3_glfw-oal", "verbose=1" ], @@ -27,7 +19,26 @@ "isDefault": true, "kind": "build" }, - "label": "Compile (Linux x64)", + "label": "Compile (Debug Linux x64)", + "options": { + "cwd": "${workspaceFolder}/build" + }, + "problemMatcher": "$gcc", + "type": "shell" + }, + { + "args": [ + "-j5", + "config=release_linux-amd64-librw_gl3_glfw-oal", + "verbose=1" + ], + "command": "make", + "dependsOn": "Premake (Linux)", + "group": { + "isDefault": true, + "kind": "build" + }, + "label": "Compile (Release Linux x64)", "options": { "cwd": "${workspaceFolder}/build" }, From 9250b36431de23ae52511672e080a9cb1afc1999 Mon Sep 17 00:00:00 2001 From: Andrew Udvare Date: Thu, 8 Oct 2020 23:19:55 -0400 Subject: [PATCH 3/5] vscode: add macOS configurations --- .vscode/c_cpp_properties.json | 30 +++++++++++++++++++++++ .vscode/launch.json | 46 +++++++++++++++++++++++++++++++++-- .vscode/tasks.json | 45 ++++++++++++++++++++++++++++++++++ 3 files changed, 119 insertions(+), 2 deletions(-) create mode 100644 .vscode/c_cpp_properties.json diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 00000000..f284b5eb --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,30 @@ +{ + "configurations": [ + { + "name": "Mac", + "includePath": [ + "${default}", + "src/fakerw", + "src/math", + "src/render", + "src/skel", + "vendor/librw" + ], + "defines": [], + "macFrameworkPath": [ + "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks" + ], + "compilerPath": "/opt/local/bin/clang", + "compilerArgs": ["-g"], + "cStandard": "gnu11", + "cppStandard": "gnu++14", + "browse": { + "path": [ + "/opt/local/include", + "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include" + ] + } + } + ], + "version": 4 +} diff --git a/.vscode/launch.json b/.vscode/launch.json index a98dfa3f..82ce041f 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -6,7 +6,7 @@ "cwd": "${workspaceFolder}", "environment": [], "externalConsole": false, - "name": "(gdb) Launch (Debug)", + "name": "(gdb) Launch (Linux Debug)", "preLaunchTask": "Compile (Debug Linux x64)", "program": "${workspaceFolder}/bin/linux-amd64-librw_gl3_glfw-oal/Debug/re3", "request": "launch", @@ -27,7 +27,7 @@ "cwd": "${workspaceFolder}", "environment": [], "externalConsole": false, - "name": "(gdb) Launch (Release)", + "name": "(gdb) Launch (Linux Release)", "preLaunchTask": "Compile (Release Linux x64)", "program": "${workspaceFolder}/bin/linux-amd64-librw_gl3_glfw-oal/Release/re3", "request": "launch", @@ -41,6 +41,48 @@ "stopAtEntry": false, "targetArchitecture": "x64", "type": "cppdbg" + }, + { + "MIMode": "lldb", + "args": [], + "cwd": "${workspaceFolder}", + "environment": [], + "externalConsole": false, + "name": "(lldb) Launch (macOS Debug)", + "preLaunchTask": "Compile (Debug macOS x64)", + "program": "${workspaceFolder}/bin/macosx-amd64-librw_gl3_glfw-oal/Debug/re3.app", + "request": "launch", + "setupCommands": [ + { + "description": "Enable pretty-printing for lldb", + "ignoreFailures": true, + "text": "-enable-pretty-printing" + } + ], + "stopAtEntry": false, + "targetArchitecture": "x64", + "type": "cppdbg" + }, + { + "MIMode": "lldb", + "args": [], + "cwd": "${workspaceFolder}", + "environment": [], + "externalConsole": false, + "name": "(lldb) Launch (macOS Release)", + "preLaunchTask": "Compile (Release macOS x64)", + "program": "${workspaceFolder}/bin/macosx-amd64-librw_gl3_glfw-oal/Release/re3.app", + "request": "launch", + "setupCommands": [ + { + "description": "Enable pretty-printing for lldb", + "ignoreFailures": true, + "text": "-enable-pretty-printing" + } + ], + "stopAtEntry": false, + "targetArchitecture": "x64", + "type": "cppdbg" } ], "version": "0.2.0" diff --git a/.vscode/tasks.json b/.vscode/tasks.json index c4fdc285..0f610d5f 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -7,6 +7,13 @@ "problemMatcher": "$gcc", "type": "shell" }, + { + "args": ["--with-librw", "gmake2"], + "command": "premake5", + "label": "Premake (macOS)", + "problemMatcher": "$gcc", + "type": "shell" + }, { "args": [ "-j5", @@ -44,6 +51,44 @@ }, "problemMatcher": "$gcc", "type": "shell" + }, + { + "args": [ + "-j5", + "config=debug_macosx-amd64-librw_gl3_glfw-oal", + "verbose=1" + ], + "command": "make", + "dependsOn": "Premake (macOS)", + "group": { + "isDefault": true, + "kind": "build" + }, + "label": "Compile (Debug macOS x64)", + "options": { + "cwd": "${workspaceFolder}/build" + }, + "problemMatcher": "$gcc", + "type": "shell" + }, + { + "args": [ + "-j5", + "config=release_macosx-amd64-librw_gl3_glfw-oal", + "verbose=1" + ], + "command": "make", + "dependsOn": "Premake (macOS)", + "group": { + "isDefault": true, + "kind": "build" + }, + "label": "Compile (Release macOS x64)", + "options": { + "cwd": "${workspaceFolder}/build" + }, + "problemMatcher": "$gcc", + "type": "shell" } ], "version": "2.0.0" From 53f6c6f8e9b374a3da04ad3b8faea2e8fdafb756 Mon Sep 17 00:00:00 2001 From: Andrew Udvare Date: Fri, 9 Oct 2020 02:01:46 -0400 Subject: [PATCH 4/5] .vscode/c_cpp_properties: add Linux configuration --- .vscode/c_cpp_properties.json | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index f284b5eb..327d8cc7 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -2,14 +2,7 @@ "configurations": [ { "name": "Mac", - "includePath": [ - "${default}", - "src/fakerw", - "src/math", - "src/render", - "src/skel", - "vendor/librw" - ], + "includePath": ["${default}"], "defines": [], "macFrameworkPath": [ "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks" @@ -24,6 +17,15 @@ "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include" ] } + }, + { + "name": "Linux", + "includePath": ["${default}"], + "defines": ["XDG_ROOT"], + "compilerPath": "/usr/bin/gcc", + "compilerArgs": ["-ggdb"], + "cStandard": "gnu11", + "cppStandard": "gnu++14" } ], "version": 4 From bbdfbe032ef43b021a709f19665ec4c1ba7cb444 Mon Sep 17 00:00:00 2001 From: Andrew Udvare Date: Fri, 9 Oct 2020 02:01:53 -0400 Subject: [PATCH 5/5] .vscode/settings: fix include path --- .vscode/settings.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.vscode/settings.json b/.vscode/settings.json index d37e8ae8..10cb5627 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,10 +2,24 @@ "C_Cpp.default.cStandard": "gnu11", "C_Cpp.default.cppStandard": "gnu++14", "C_Cpp.default.includePath": [ + "src/animation", + "src/audio", + "src/control", + "src/core", + "src/entities", + "src/extras", "src/fakerw", "src/math", + "src/modelinfo", + "src/objects", + "src/peds", "src/render", + "src/rw", + "src/save", "src/skel", + "src/text", + "src/vehicles", + "src/weapons", "vendor/librw" ], "C_Cpp.vcFormat.indent.gotoLabels": "leftmostColumn",