From 74642ba1c634ca6e5b09a6c45855dcb9497feebb Mon Sep 17 00:00:00 2001 From: JuDelCo Date: Tue, 12 Nov 2019 19:30:45 +0100 Subject: [PATCH] Fix VSCode template for debugging. (#1014) --- projects/VSCode/.vscode/launch.json | 6 +++--- projects/VSCode/.vscode/tasks.json | 2 +- projects/VSCode/Makefile | 9 ++++++--- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/projects/VSCode/.vscode/launch.json b/projects/VSCode/.vscode/launch.json index afb54b7f..b65aa1c1 100644 --- a/projects/VSCode/.vscode/launch.json +++ b/projects/VSCode/.vscode/launch.json @@ -8,7 +8,7 @@ "name": "Debug", "type": "cppdbg", "request": "launch", - "program": "${workspaceFolder}/${fileBasenameNoExtension}", + "program": "${workspaceFolder}/game", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", @@ -42,10 +42,10 @@ "cwd": "${workspaceFolder}", "environment": [], "externalConsole": false, - "program": "${workspaceFolder}/${fileBasenameNoExtension}", + "program": "${workspaceFolder}/game", "MIMode": "gdb", "windows": { - "program": "${workspaceFolder}/${fileBasenameNoExtension}.exe", + "program": "${workspaceFolder}/game.exe", "miDebuggerPath": "C:/raylib/mingw/bin/gdb.exe" }, "osx": { diff --git a/projects/VSCode/.vscode/tasks.json b/projects/VSCode/.vscode/tasks.json index e701baad..cf5905f8 100644 --- a/projects/VSCode/.vscode/tasks.json +++ b/projects/VSCode/.vscode/tasks.json @@ -9,7 +9,7 @@ "command": "make", "args": [ "PLATFORM=PLATFORM_DESKTOP", - "DEBUGGING=TRUE" + "BUILD_MODE=DEBUG" ], "windows": { "command": "C:/raylib/mingw/bin/mingw32-make.exe", diff --git a/projects/VSCode/Makefile b/projects/VSCode/Makefile index 13a2853b..64d07f1d 100644 --- a/projects/VSCode/Makefile +++ b/projects/VSCode/Makefile @@ -183,18 +183,21 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) endif # Define compiler flags: +# -O0 defines optimization level (no optimization, better for debugging) # -O1 defines optimization level # -g include debug information on compilation -# -s strip unnecessary data from build +# -s strip unnecessary data from build -> do not use in debug builds # -Wall turns on most, but not all, compiler warnings # -std=c99 defines C language mode (standard C from 1999 revision) # -std=gnu99 defines C language mode (GNU C from 1999 revision) # -Wno-missing-braces ignore invalid warning (GCC bug 53119) # -D_DEFAULT_SOURCE use with -std=c99 on Linux and PLATFORM_WEB, required for timespec -CFLAGS += -O1 -s -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces +CFLAGS += -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces ifeq ($(BUILD_MODE),DEBUG) - CFLAGS += -g + CFLAGS += -g -O0 +else + CFLAGS += -s -O1 endif # Additional flags for compiler (if desired)