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(...@@ -492,11 +492,11 @@ pub fn linkSystemLibrary(
492 const b = m.owner;492 const b = m.owner;
493493
494 const target = m.requireKnownTarget();494 const target = m.requireKnownTarget();
495 if (target.is_libc_lib_name(name)) {495 if (target.isLibCLibName(name)) {
496 m.link_libc = true;496 m.link_libc = true;
497 return;497 return;
498 }498 }
499 if (target.is_libcpp_lib_name(name)) {499 if (target.isLibCxxLibName(name)) {
500 m.link_libcpp = true;500 m.link_libcpp = true;
501 return;501 return;
502 }502 }
lib/std/Build/Step/Compile.zig+2-2
...@@ -611,11 +611,11 @@ pub fn dependsOnSystemLibrary(compile: *const Compile, name: []const u8) bool {...@@ -611,11 +611,11 @@ pub fn dependsOnSystemLibrary(compile: *const Compile, name: []const u8) bool {
611 is_linking_libcpp = is_linking_libcpp or module.link_libcpp == true;611 is_linking_libcpp = is_linking_libcpp or module.link_libcpp == true;
612 }612 }
613613
614 if (compile.rootModuleTarget().is_libc_lib_name(name)) {614 if (compile.rootModuleTarget().isLibCLibName(name)) {
615 return is_linking_libc;615 return is_linking_libc;
616 }616 }
617617
618 if (compile.rootModuleTarget().is_libcpp_lib_name(name)) {618 if (compile.rootModuleTarget().isLibCxxLibName(name)) {
619 return is_linking_libcpp;619 return is_linking_libcpp;
620 }620 }
621621
lib/std/Target.zig+2-2
...@@ -2868,7 +2868,7 @@ pub fn cTypePreferredAlignment(target: Target, c_type: CType) u16 {...@@ -2868,7 +2868,7 @@ pub fn cTypePreferredAlignment(target: Target, c_type: CType) u16 {
2868 );2868 );
2869}2869}
28702870
2871pub fn is_libc_lib_name(target: std.Target, name: []const u8) bool {2871pub fn isLibCLibName(target: std.Target, name: []const u8) bool {
2872 const ignore_case = target.os.tag == .macos or target.os.tag == .windows;2872 const ignore_case = target.os.tag == .macos or target.os.tag == .windows;
28732873
2874 if (eqlIgnoreCase(ignore_case, name, "c"))2874 if (eqlIgnoreCase(ignore_case, name, "c"))
...@@ -2987,7 +2987,7 @@ pub fn is_libc_lib_name(target: std.Target, name: []const u8) bool {...@@ -2987,7 +2987,7 @@ pub fn is_libc_lib_name(target: std.Target, name: []const u8) bool {
2987 return false;2987 return false;
2988}2988}
29892989
2990pub fn is_libcpp_lib_name(target: std.Target, name: []const u8) bool {2990pub fn isLibCxxLibName(target: std.Target, name: []const u8) bool {
2991 const ignore_case = target.os.tag.isDarwin() or target.os.tag == .windows;2991 const ignore_case = target.os.tag.isDarwin() or target.os.tag == .windows;
29922992
2993 return eqlIgnoreCase(ignore_case, name, "c++") or2993 return eqlIgnoreCase(ignore_case, name, "c++") or
src/Sema.zig+2-2
...@@ -9606,7 +9606,7 @@ fn handleExternLibName(...@@ -9606,7 +9606,7 @@ fn handleExternLibName(
9606 const comp = zcu.comp;9606 const comp = zcu.comp;
9607 const target = zcu.getTarget();9607 const target = zcu.getTarget();
9608 log.debug("extern fn symbol expected in lib '{s}'", .{lib_name});9608 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)) {
9610 if (!comp.config.link_libc) {9610 if (!comp.config.link_libc) {
9611 return sema.fail(9611 return sema.fail(
9612 block,9612 block,
...@@ -9617,7 +9617,7 @@ fn handleExternLibName(...@@ -9617,7 +9617,7 @@ fn handleExternLibName(
9617 }9617 }
9618 break :blk;9618 break :blk;
9619 }9619 }
9620 if (target.is_libcpp_lib_name(lib_name)) {9620 if (target.isLibCxxLibName(lib_name)) {
9621 if (!comp.config.link_libcpp) return sema.fail(9621 if (!comp.config.link_libcpp) return sema.fail(
9622 block,9622 block,
9623 src_loc,9623 src_loc,
src/main.zig+2-2
...@@ -3765,11 +3765,11 @@ fn createModule(...@@ -3765,11 +3765,11 @@ fn createModule(
3765 info: SystemLib,3765 info: SystemLib,
3766 }) = .{};3766 }) = .{};
3767 for (create_module.system_libs.keys(), create_module.system_libs.values()) |lib_name, info| {3767 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)) {
3769 create_module.opts.link_libc = true;3769 create_module.opts.link_libc = true;
3770 continue;3770 continue;
3771 }3771 }
3772 if (target.is_libcpp_lib_name(lib_name)) {3772 if (target.isLibCxxLibName(lib_name)) {
3773 create_module.opts.link_libcpp = true;3773 create_module.opts.link_libcpp = true;
3774 continue;3774 continue;
3775 }3775 }