From 2464d2765a22946e7064d2c3fafe0eb33e6eeb36 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Sat, 21 Aug 2021 22:56:21 +0200 Subject: [PATCH] PATH environment split char is ';' on windows and ':' on unix --- .vscode/launch.json | 11 +++++++++++ .vscode/tasks.json | 14 ++++++++++++++ SpirVTasks/CompileGLSLTask.cs | 4 ++-- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 8bb526e..d5a945d 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -26,6 +26,17 @@ "stopAtEntry": false, "console": "internalConsole" }, + { + "name": ".NET Core Launch (Textured)", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build Textured", + "program": "${workspaceFolder}/build/Debug/netcoreapp3.1/Textured", + "args": [], + "cwd": "${workspaceFolder}/build/Debug/netcoreapp3.1/", + "stopAtEntry": false, + "console": "internalConsole" + }, { "name": ".NET Core Launch (pbr)", "type": "coreclr", diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 1c80658..9f2434f 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -15,6 +15,20 @@ ], "problemMatcher": "$msCompile" }, + { + "label": "build Textured", + "command": "dotnet", + "type": "process", + "args": [ + "build", + "${workspaceFolder}/samples/Textured/Textured.csproj", + "/property:GenerateFullPaths=true", + "/property:SolutionDir=${workspaceFolder}/", + "/property:Configuration=Debug", + "/consoleloggerparameters:NoSummary" + ], + "problemMatcher": "$msCompile" + }, { "label": "build ClearScreen", "command": "dotnet", diff --git a/SpirVTasks/CompileGLSLTask.cs b/SpirVTasks/CompileGLSLTask.cs index ea71ca9..51e840c 100644 --- a/SpirVTasks/CompileGLSLTask.cs +++ b/SpirVTasks/CompileGLSLTask.cs @@ -144,7 +144,7 @@ namespace SpirVTasks { } string glslcExec = "glslc"; - if (Environment.OSVersion.Platform.ToString ().StartsWith ("Win", StringComparison.Ordinal)) + if (Environment.OSVersion.Platform.ToString ().StartsWith ("Win", StringComparison.Ordinal)) glslcExec = glslcExec + ".exe"; string vkSdk = Environment.GetEnvironmentVariable ("VULKAN_SDK"); @@ -157,7 +157,7 @@ namespace SpirVTasks { string envStrPathes = Environment.GetEnvironmentVariable ("PATH"); if (!string.IsNullOrEmpty (envStrPathes)) { - foreach (string path in envStrPathes.Split (':')) { + foreach (string path in envStrPathes.Split (Environment.OSVersion.Platform == PlatformID.Unix ? ':' : ';')) { glslcPath = Path.Combine (path, glslcExec); if (File.Exists (glslcPath)) return true; -- 2.47.3