authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-10-08 06:42:42+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-10-16 22:24:46+02:00
logc76a98f28a2623d0622b373f3b6d9aa23c3da54a
tree1e6fb67da705efd7d84663b41e34518f35cc000d
parent482759079f423681928467bf0f68a755a1a1a087
signature Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.Target: Rename is_lib{c,cxx}_lib_name() to isLib{C,Cxx}LibName().


5 files changed, 10 insertions(+), 10 deletions(-)

lib/std/Build/Module.zig+2-2
......@@ -492,11 +492,11 @@ pub fn linkSystemLibrary(
492492 const b = m.owner;
493493
494494 const target = m.requireKnownTarget();
495 if (target.is_libc_lib_name(name)) {
495 if (target.isLibCLibName(name)) {
496496 m.link_libc = true;
497497 return;
498498 }
499 if (target.is_libcpp_lib_name(name)) {
499 if (target.isLibCxxLibName(name)) {
500500 m.link_libcpp = true;
501501 return;
502502 }
lib/std/Build/Step/Compile.zig+2-2
......@@ -611,11 +611,11 @@ pub fn dependsOnSystemLibrary(compile: *const Compile, name: []const u8) bool {
611611 is_linking_libcpp = is_linking_libcpp or module.link_libcpp == true;
612612 }
613613
614 if (compile.rootModuleTarget().is_libc_lib_name(name)) {
614 if (compile.rootModuleTarget().isLibCLibName(name)) {
615615 return is_linking_libc;
616616 }
617617
618 if (compile.rootModuleTarget().is_libcpp_lib_name(name)) {
618 if (compile.rootModuleTarget().isLibCxxLibName(name)) {
619619 return is_linking_libcpp;
620620 }
621621
lib/std/Target.zig+2-2
......@@ -2868,7 +2868,7 @@ pub fn cTypePreferredAlignment(target: Target, c_type: CType) u16 {
28682868 );
28692869}
28702870
2871pub fn is_libc_lib_name(target: std.Target, name: []const u8) bool {
2871pub fn isLibCLibName(target: std.Target, name: []const u8) bool {
28722872 const ignore_case = target.os.tag == .macos or target.os.tag == .windows;
28732873
28742874 if (eqlIgnoreCase(ignore_case, name, "c"))
......@@ -2987,7 +2987,7 @@ pub fn is_libc_lib_name(target: std.Target, name: []const u8) bool {
29872987 return false;
29882988}
29892989
2990pub fn is_libcpp_lib_name(target: std.Target, name: []const u8) bool {
2990pub fn isLibCxxLibName(target: std.Target, name: []const u8) bool {
29912991 const ignore_case = target.os.tag.isDarwin() or target.os.tag == .windows;
29922992
29932993 return eqlIgnoreCase(ignore_case, name, "c++") or
src/Sema.zig+2-2
......@@ -9606,7 +9606,7 @@ fn handleExternLibName(
96069606 const comp = zcu.comp;
96079607 const target = zcu.getTarget();
96089608 log.debug("extern fn symbol expected in lib '{s}'", .{lib_name});
9609 if (target.is_libc_lib_name(lib_name)) {
9609 if (target.isLibCLibName(lib_name)) {
96109610 if (!comp.config.link_libc) {
96119611 return sema.fail(
96129612 block,
......@@ -9617,7 +9617,7 @@ fn handleExternLibName(
96179617 }
96189618 break :blk;
96199619 }
9620 if (target.is_libcpp_lib_name(lib_name)) {
9620 if (target.isLibCxxLibName(lib_name)) {
96219621 if (!comp.config.link_libcpp) return sema.fail(
96229622 block,
96239623 src_loc,
src/main.zig+2-2
......@@ -3765,11 +3765,11 @@ fn createModule(
37653765 info: SystemLib,
37663766 }) = .{};
37673767 for (create_module.system_libs.keys(), create_module.system_libs.values()) |lib_name, info| {
3768 if (target.is_libc_lib_name(lib_name)) {
3768 if (target.isLibCLibName(lib_name)) {
37693769 create_module.opts.link_libc = true;
37703770 continue;
37713771 }
3772 if (target.is_libcpp_lib_name(lib_name)) {
3772 if (target.isLibCxxLibName(lib_name)) {
37733773 create_module.opts.link_libcpp = true;
37743774 continue;
37753775 }