diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 1c768169..0fc46313 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -113,6 +113,25 @@ }, "group": "build", "problemMatcher": "$gcc" + }, + { + "label": "Run Demo - GraphicsTest", + "type": "shell", + "command": "bash", + "args": [ + "-l", + "tasks.sh", + "--run", + "graphicstest.exe", + ], + "options": { + "cwd": "${workspaceFolder}" + }, + "dependsOn": [ + "Build XEGE Library" + ], + "group": "build", + "problemMatcher": "$gcc" } ] } \ No newline at end of file diff --git a/tasks.sh b/tasks.sh index eba41f81..1cc3579b 100755 --- a/tasks.sh +++ b/tasks.sh @@ -36,6 +36,10 @@ function isWindows() { isWsl || [[ -d "/c" ]] || [[ -d "/cygdrive/c" ]] } +function isMacOS() { + [[ "$(uname)" == "Darwin" ]] +} + function loadCMakeProject() { if mkdir -p "$CMAKE_VS_DIR" && cd "$CMAKE_VS_DIR" && @@ -125,6 +129,16 @@ while [[ $# > 0 ]]; do shift shift ;; + --run) + echo "run $2" + if isWindows; then + "$CMAKE_VS_DIR/$2" + elif isMacOS; then + wine64 "$CMAKE_VS_DIR/$2" + fi + shift + shift + ;; *) echo "unknown option $PARSE_KEY..." exit 1