From a0973af030189eecbb6fdb9c7133636b04e1fe03 Mon Sep 17 00:00:00 2001 From: Ali Chraghi Date: Sat, 27 Aug 2022 20:33:30 +0430 Subject: [PATCH] build: replace depracted functions --- libs/basisu/build.zig | 4 ++-- libs/glfw/build.zig | 4 ++-- libs/glfw/system_sdk.zig | 28 ++++++++++++++-------------- libs/gpu-dawn/sdk.zig | 10 +++++----- libs/gpu/sdk.zig | 2 +- 5 files changed, 24 insertions(+), 24 deletions(-) diff --git a/libs/basisu/build.zig b/libs/basisu/build.zig index 1dfefff4..f2f9b2aa 100644 --- a/libs/basisu/build.zig +++ b/libs/basisu/build.zig @@ -35,12 +35,12 @@ pub fn link(b: *Builder, step: *std.build.LibExeObjStep, options: Options) void if (options.encoder) { step.linkLibrary(buildEncoder(b)); step.addCSourceFile(comptime thisDir() ++ "/src/encoder/wrapper.cpp", &.{}); - step.addIncludeDir(basisu_root ++ "/encoder"); + step.addIncludePath(basisu_root ++ "/encoder"); } if (options.transcoder) { step.linkLibrary(buildTranscoder(b)); step.addCSourceFile(comptime thisDir() ++ "/src/transcoder/wrapper.cpp", &.{}); - step.addIncludeDir(basisu_root ++ "/transcoder"); + step.addIncludePath(basisu_root ++ "/transcoder"); } } diff --git a/libs/glfw/build.zig b/libs/glfw/build.zig index f70a4e1b..8132a75f 100644 --- a/libs/glfw/build.zig +++ b/libs/glfw/build.zig @@ -94,8 +94,8 @@ fn buildLibrary(b: *Builder, step: *std.build.LibExeObjStep, options: Options) * } fn addGLFWIncludes(step: *std.build.LibExeObjStep) void { - step.addIncludeDir(thisDir() ++ "/upstream/glfw/include"); - step.addIncludeDir(thisDir() ++ "/upstream/vulkan_headers/include"); + step.addIncludePath(thisDir() ++ "/upstream/glfw/include"); + step.addIncludePath(thisDir() ++ "/upstream/vulkan_headers/include"); } fn addGLFWSources(b: *Builder, step: *std.build.LibExeObjStep, lib: *std.build.LibExeObjStep, options: Options) void { diff --git a/libs/glfw/system_sdk.zig b/libs/glfw/system_sdk.zig index 583a9dd8..34c441b2 100644 --- a/libs/glfw/system_sdk.zig +++ b/libs/glfw/system_sdk.zig @@ -83,9 +83,9 @@ fn includeSdkMacOS(b: *Builder, step: *std.build.LibExeObjStep, options: Options const sdk_root_dir = getSdkRoot(b.allocator, step, options.github_org, sdk_name, sdk_revision) catch unreachable; if (options.set_sysroot) { - step.addFrameworkDir("/System/Library/Frameworks"); - step.addSystemIncludeDir("/usr/include"); - step.addLibPath("/usr/lib"); + step.addFrameworkPath("/System/Library/Frameworks"); + step.addSystemIncludePath("/usr/include"); + step.addLibraryPath("/usr/lib"); var sdk_sysroot = std.fs.path.join(b.allocator, &.{ sdk_root_dir, "root/" }) catch unreachable; b.sysroot = sdk_sysroot; @@ -93,13 +93,13 @@ fn includeSdkMacOS(b: *Builder, step: *std.build.LibExeObjStep, options: Options } var sdk_framework_dir = std.fs.path.join(b.allocator, &.{ sdk_root_dir, "root/System/Library/Frameworks" }) catch unreachable; - step.addFrameworkDir(sdk_framework_dir); + step.addFrameworkPath(sdk_framework_dir); var sdk_include_dir = std.fs.path.join(b.allocator, &.{ sdk_root_dir, "root/usr/include" }) catch unreachable; - step.addSystemIncludeDir(sdk_include_dir); + step.addSystemIncludePath(sdk_include_dir); var sdk_lib_dir = std.fs.path.join(b.allocator, &.{ sdk_root_dir, "root/usr/lib" }) catch unreachable; - step.addLibPath(sdk_lib_dir); + step.addLibraryPath(sdk_lib_dir); } fn includeSdkLinuxX8664(b: *Builder, step: *std.build.LibExeObjStep, options: Options) void { @@ -119,9 +119,9 @@ fn includeSdkLinuxX8664(b: *Builder, step: *std.build.LibExeObjStep, options: Op b.allocator.free(wayland_protocols_include); b.allocator.free(sdk_root_libs); } - step.addSystemIncludeDir(sdk_root_includes); - step.addSystemIncludeDir(wayland_protocols_include); - step.addLibPath(sdk_root_libs); + step.addSystemIncludePath(sdk_root_includes); + step.addSystemIncludePath(wayland_protocols_include); + step.addLibraryPath(sdk_root_libs); } fn includeSdkLinuxAarch64(b: *Builder, step: *std.build.LibExeObjStep, options: Options) void { @@ -141,9 +141,9 @@ fn includeSdkLinuxAarch64(b: *Builder, step: *std.build.LibExeObjStep, options: b.allocator.free(wayland_protocols_include); b.allocator.free(sdk_root_libs); } - step.addSystemIncludeDir(sdk_root_includes); - step.addSystemIncludeDir(wayland_protocols_include); - step.addLibPath(sdk_root_libs); + step.addSystemIncludePath(sdk_root_includes); + step.addSystemIncludePath(wayland_protocols_include); + step.addLibraryPath(sdk_root_libs); } fn includeSdkWindowsX8664(b: *Builder, step: *std.build.LibExeObjStep, options: Options) void { @@ -163,8 +163,8 @@ fn includeSdkWindowsX8664(b: *Builder, step: *std.build.LibExeObjStep, options: b.allocator.free(sdk_libs); } - step.addIncludeDir(sdk_includes); - step.addLibPath(sdk_libs); + step.addIncludePath(sdk_includes); + step.addLibraryPath(sdk_libs); } var cached_sdk_roots: ?std.AutoHashMap(*std.build.LibExeObjStep, []const u8) = null; diff --git a/libs/gpu-dawn/sdk.zig b/libs/gpu-dawn/sdk.zig index a47bcfd2..1150c3ec 100644 --- a/libs/gpu-dawn/sdk.zig +++ b/libs/gpu-dawn/sdk.zig @@ -83,9 +83,9 @@ pub fn Sdk(deps: anytype) type { fn linkFromSource(b: *Builder, step: *std.build.LibExeObjStep, options: Options) void { ensureSubmodules(b.allocator) catch |err| @panic(@errorName(err)); - step.addIncludeDir(comptime thisDir() ++ "/libs/dawn/out/Debug/gen/include"); - step.addIncludeDir(comptime thisDir() ++ "/libs/dawn/include"); - step.addIncludeDir(comptime thisDir() ++ "/src/dawn"); + step.addIncludePath(comptime thisDir() ++ "/libs/dawn/out/Debug/gen/include"); + step.addIncludePath(comptime thisDir() ++ "/libs/dawn/include"); + step.addIncludePath(comptime thisDir() ++ "/src/dawn"); if (options.separate_libs) { const lib_mach_dawn_native = buildLibMachDawnNative(b, step, options); @@ -213,8 +213,8 @@ pub fn Sdk(deps: anytype) type { step.linkSystemLibraryName("dawn"); step.linkLibCpp(); - step.addIncludeDir(include_dir); - step.addIncludeDir(comptime thisDir() ++ "/src/dawn"); + step.addIncludePath(include_dir); + step.addIncludePath(comptime thisDir() ++ "/src/dawn"); if (options.linux_window_manager != null and options.linux_window_manager.? == .X11) { step.linkSystemLibraryName("X11"); diff --git a/libs/gpu/sdk.zig b/libs/gpu/sdk.zig index 2df6d759..1dc33170 100644 --- a/libs/gpu/sdk.zig +++ b/libs/gpu/sdk.zig @@ -29,7 +29,7 @@ pub fn Sdk(deps: anytype) type { deps.glfw.link(b, step, options.glfw_options); deps.gpu_dawn.link(b, step, options.gpu_dawn_options); step.addCSourceFile((comptime thisDir()) ++ "/src/mach_dawn.cpp", &.{"-std=c++17"}); - step.addIncludeDir((comptime thisDir()) ++ "/src"); + step.addIncludePath((comptime thisDir()) ++ "/src"); } }