From 6e595d629035bb9ee59cfeb024a923a2ead86e91 Mon Sep 17 00:00:00 2001 From: estevesnp Date: Sat, 25 Oct 2025 00:11:40 +0100 Subject: [PATCH] feat: Update zig buildExe snippet for zig 0.15.0+ --- snippets/zig.json | 54 +++++++++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 23 deletions(-) diff --git a/snippets/zig.json b/snippets/zig.json index ddf7041e..9ca721b2 100644 --- a/snippets/zig.json +++ b/snippets/zig.json @@ -1,25 +1,33 @@ { - "Import": { - "prefix": "import", - "body": ["const ${1} = @import(\"${1}\");"], - "description": "Importing Libraries" - }, - "CImport": { - "prefix": "cimport", - "body": ["const c = @cImport({", " @cDefine(\"${1}\");", "});"], - "description": "Importing C Header Files" - }, - "buildExe": { - "prefix": "bExe", - "body": [ - "const exe = b.addExecutable(.{", - " .name = \"${1}\",", - " .root_source_file = b.path(\"${2:path}\"),", - " .target = target,", - " .optimize = optimize,", - "});", - "b.installArtifact(exe);" - ], - "description": "Building an exe" - } + "Import": { + "prefix": "import", + "body": [ + "const ${1} = @import(\"${1}\");" + ], + "description": "Importing Libraries" + }, + "CImport": { + "prefix": "cimport", + "body": [ + "const c = @cImport({", + " @cDefine(\"${1}\");", + "});" + ], + "description": "Importing C Header Files" + }, + "buildExe": { + "prefix": "bExe", + "body": [ + "const exe = b.addExecutable(.{", + " .name = \"${1}\",", + " .root_module = b.createModule(.{", + " .root_source_file = b.path(\"${2:path}\"),", + " .target = target,", + " .optimize = optimize,", + " }),", + "});", + "b.installArtifact(exe);" + ], + "description": "Building an exe" + } }