Browse Source

Merge pull request #8 from MurrayIRC/vscode-updates

Vscode updates
pull/675/head
Murray Campbell 6 years ago
committed by GitHub
parent
commit
bcbe042dd2
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 61 additions and 122 deletions
  1. +24
    -74
      projects/VSCode/.vscode/launch.json
  2. +24
    -44
      projects/VSCode/.vscode/tasks.json
  3. +13
    -4
      projects/VSCode/Makefile

+ 24
- 74
projects/VSCode/.vscode/launch.json View File

@ -5,67 +5,7 @@
"version": "0.2.0", "version": "0.2.0",
"configurations": [ "configurations": [
{ {
"name": "(WIN) Debug", "name": "Debug",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/game.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "C:/raylib/mingw/bin/gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": false
}
],
"preLaunchTask": "(WIN) build debug"
},
{
"name": "(WIN) Run",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/game.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "C:/raylib/mingw/bin/gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": false
}
],
"preLaunchTask": "(WIN) build release"
},
{
"name": "(OSX) Debug",
"type": "lldb",
"request": "launch",
"program": "${workspaceFolder}/game",
"args": [],
"cwd": "${workspaceFolder}",
"preLaunchTask": "(OSX) build debug"
},
{
"name": "(OSX) Run",
"type": "lldb",
"request": "launch",
"program": "${workspaceFolder}/game",
"args": [],
"cwd": "${workspaceFolder}",
"preLaunchTask": "(OSX) build release"
},
{
"name": "(GNU) Debug",
"type": "cppdbg", "type": "cppdbg",
"request": "launch", "request": "launch",
"program": "${workspaceFolder}/game", "program": "${workspaceFolder}/game",
@ -75,7 +15,6 @@
"environment": [], "environment": [],
"externalConsole": false, "externalConsole": false,
"MIMode": "gdb", "MIMode": "gdb",
"miDebuggerPath": "/usr/bin/gdb",
"setupCommands": [ "setupCommands": [
{ {
"description": "Enable pretty-printing for gdb", "description": "Enable pretty-printing for gdb",
@ -83,28 +22,39 @@
"ignoreFailures": false "ignoreFailures": false
} }
], ],
"preLaunchTask": "(GNU) build debug" "windows": {
"miDebuggerPath": "C:/raylib/mingw/bin/gdb.exe",
},
"osx": {
"MIMode": "lldb"
},
"linux": {
"miDebuggerPath": "/usr/bin/gdb",
},
"preLaunchTask": "build debug"
}, },
{ {
"name": "(GNU) Run", "name": "Run",
"type": "cppdbg", "type": "cppdbg",
"request": "launch", "request": "launch",
"program": "${workspaceFolder}/game",
"args": [], "args": [],
"stopAtEntry": false, "stopAtEntry": false,
"cwd": "${workspaceFolder}", "cwd": "${workspaceFolder}",
"environment": [], "environment": [],
"externalConsole": false, "externalConsole": false,
"program": "${workspaceFolder}/game",
"MIMode": "gdb", "MIMode": "gdb",
"miDebuggerPath": "/usr/bin/gdb", "windows": {
"setupCommands": [ "program": "${workspaceFolder}/game.exe",
{ "miDebuggerPath": "C:/raylib/mingw/bin/gdb.exe"
"description": "Enable pretty-printing for gdb", },
"text": "-enable-pretty-printing", "osx": {
"ignoreFailures": false "MIMode": "lldb"
} },
], "linux": {
"preLaunchTask": "(GNU) build release" "miDebuggerPath": "/usr/bin/gdb"
},
"preLaunchTask": "build release",
} }
] ]
} }

+ 24
- 44
projects/VSCode/.vscode/tasks.json View File

@ -4,67 +4,47 @@
"version": "2.0.0", "version": "2.0.0",
"tasks": [ "tasks": [
{ {
"label": "(WIN) build release", "label": "build debug",
"type": "process",
"command": "C:/raylib/mingw/bin/mingw32-make.exe",
"args": [
"PLATFORM=PLATFORM_DESKTOP",
"RAYLIB_PATH=C:/raylib/raylib",
],
"group": "build"
},
{
"label": "(WIN) build debug",
"type": "process",
"command": "C:/raylib/mingw/bin/mingw32-make.exe",
"args": [
"PLATFORM=PLATFORM_DESKTOP",
"RAYLIB_PATH=C:/raylib/raylib",
"DEBUGGING=TRUE"
],
"group": "build"
},
{
"label": "(OSX) build debug",
"type": "process",
"command": "make",
"args": [
"PLATFORM=PLATFORM_DESKTOP",
"RAYLIB_PATH=<path_to_raylib>",
"DEBUGGING=TRUE"
],
"group": "build"
},
{
"label": "(OSX) build release",
"type": "process",
"command": "make",
"args": [
"PLATFORM=PLATFORM_DESKTOP",
"RAYLIB_PATH=<path_to_raylib>",
],
"group": "build"
},
{
"label": "(GNU) build debug",
"type": "process", "type": "process",
"command": "make", "command": "make",
"args": [ "args": [
"PLATFORM=PLATFORM_DESKTOP", "PLATFORM=PLATFORM_DESKTOP",
"DEBUGGING=TRUE" "DEBUGGING=TRUE"
], ],
"windows": {
"command": "C:/raylib/mingw/bin/mingw32-make.exe",
"args": [
"RAYLIB_PATH=C:/raylib/raylib"
],
},
"osx": {
"args": [
"RAYLIB_PATH=/Users/murray/work/ray/raylib"
],
},
"group": { "group": {
"kind": "build", "kind": "build",
"isDefault": true "isDefault": true
} }
}, },
{ {
"label": "(GNU) build release", "label": "build release",
"type": "process", "type": "process",
"command": "make", "command": "make",
"args": [ "args": [
"PLATFORM=PLATFORM_DESKTOP", "PLATFORM=PLATFORM_DESKTOP",
], ],
"windows": {
"command": "C:/raylib/mingw/bin/mingw32-make.exe",
"args": [
"RAYLIB_PATH=C:/raylib/raylib",
],
},
"osx": {
"args": [
"RAYLIB_PATH=/Users/murray/work/ray/raylib",
],
},
"group": "build" "group": "build"
} }
] ]

+ 13
- 4
projects/VSCode/Makefile View File

@ -151,6 +151,9 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),LINUX) ifeq ($(PLATFORM_OS),LINUX)
MAKE = make MAKE = make
endif endif
ifeq ($(PLATFORM_OS),OSX)
MAKE = make
endif
endif endif
# Define compiler flags: # Define compiler flags:
@ -279,17 +282,22 @@ ifeq ($(PLATFORM),PLATFORM_WEB)
LDLIBS = $(RAYLIB_RELEASE_PATH)/libraylib.bc LDLIBS = $(RAYLIB_RELEASE_PATH)/libraylib.bc
endif endif
# Define a recursive wildcard function
rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $(subst *,%,$2),$d))
# Define all source files required # Define all source files required
PROJECT_SOURCE_FILES ?= main.c SRC_DIR = src
OBJ_DIR = obj
# Define all object files from source files # Define all object files from source files
OBJS = $(patsubst %.c, %.o, $(PROJECT_SOURCE_FILES)) SRC = $(call rwildcard, *.c, *.h)
OBJS = $(SRC:$(SRC_DIR)/%.c=$(OBJ_DIR)/%.o)
# For Android platform we call a custom Makefile.Android # For Android platform we call a custom Makefile.Android
ifeq ($(PLATFORM),PLATFORM_ANDROID) ifeq ($(PLATFORM),PLATFORM_ANDROID)
MAKEFILE_PARAMS = -f Makefile.Android MAKEFILE_PARAMS = -f Makefile.Android
export PROJECT_NAME export PROJECT_NAME
export PROJECT_SOURCE_FILES export SRC_DIR
else else
MAKEFILE_PARAMS = $(PROJECT_NAME) MAKEFILE_PARAMS = $(PROJECT_NAME)
endif endif
@ -305,7 +313,8 @@ $(PROJECT_NAME): $(OBJS)
# Compile source files # Compile source files
# NOTE: This pattern will compile every module defined on $(OBJS) # NOTE: This pattern will compile every module defined on $(OBJS)
%.o: %.c #%.o: %.c
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c
$(CC) -c $< -o $@ $(CFLAGS) $(INCLUDE_PATHS) -D$(PLATFORM) $(CC) -c $< -o $@ $(CFLAGS) $(INCLUDE_PATHS) -D$(PLATFORM)
# Clean everything # Clean everything

||||||
x
 
000:0
Loading…
Cancel
Save