Commit c76a98f28a

Alex Rønne Petersen <alex@alexrp.com>
2024-10-08 06:42:42
std.Target: Rename is_lib{c,cxx}_lib_name() to isLib{C,Cxx}LibName().
1 parent 4827590
Changed files (5)
lib/std/Build/Step/Compile.zig
@@ -611,11 +611,11 @@ pub fn dependsOnSystemLibrary(compile: *const Compile, name: []const u8) bool {
         is_linking_libcpp = is_linking_libcpp or module.link_libcpp == true;
     }
 
-    if (compile.rootModuleTarget().is_libc_lib_name(name)) {
+    if (compile.rootModuleTarget().isLibCLibName(name)) {
         return is_linking_libc;
     }
 
-    if (compile.rootModuleTarget().is_libcpp_lib_name(name)) {
+    if (compile.rootModuleTarget().isLibCxxLibName(name)) {
         return is_linking_libcpp;
     }
 
lib/std/Build/Module.zig
@@ -492,11 +492,11 @@ pub fn linkSystemLibrary(
     const b = m.owner;
 
     const target = m.requireKnownTarget();
-    if (target.is_libc_lib_name(name)) {
+    if (target.isLibCLibName(name)) {
         m.link_libc = true;
         return;
     }
-    if (target.is_libcpp_lib_name(name)) {
+    if (target.isLibCxxLibName(name)) {
         m.link_libcpp = true;
         return;
     }
lib/std/Target.zig
@@ -2868,7 +2868,7 @@ pub fn cTypePreferredAlignment(target: Target, c_type: CType) u16 {
     );
 }
 
-pub fn is_libc_lib_name(target: std.Target, name: []const u8) bool {
+pub fn isLibCLibName(target: std.Target, name: []const u8) bool {
     const ignore_case = target.os.tag == .macos or target.os.tag == .windows;
 
     if (eqlIgnoreCase(ignore_case, name, "c"))
@@ -2987,7 +2987,7 @@ pub fn is_libc_lib_name(target: std.Target, name: []const u8) bool {
     return false;
 }
 
-pub fn is_libcpp_lib_name(target: std.Target, name: []const u8) bool {
+pub fn isLibCxxLibName(target: std.Target, name: []const u8) bool {
     const ignore_case = target.os.tag.isDarwin() or target.os.tag == .windows;
 
     return eqlIgnoreCase(ignore_case, name, "c++") or
src/main.zig
@@ -3765,11 +3765,11 @@ fn createModule(
             info: SystemLib,
         }) = .{};
         for (create_module.system_libs.keys(), create_module.system_libs.values()) |lib_name, info| {
-            if (target.is_libc_lib_name(lib_name)) {
+            if (target.isLibCLibName(lib_name)) {
                 create_module.opts.link_libc = true;
                 continue;
             }
-            if (target.is_libcpp_lib_name(lib_name)) {
+            if (target.isLibCxxLibName(lib_name)) {
                 create_module.opts.link_libcpp = true;
                 continue;
             }
src/Sema.zig
@@ -9606,7 +9606,7 @@ fn handleExternLibName(
         const comp = zcu.comp;
         const target = zcu.getTarget();
         log.debug("extern fn symbol expected in lib '{s}'", .{lib_name});
-        if (target.is_libc_lib_name(lib_name)) {
+        if (target.isLibCLibName(lib_name)) {
             if (!comp.config.link_libc) {
                 return sema.fail(
                     block,
@@ -9617,7 +9617,7 @@ fn handleExternLibName(
             }
             break :blk;
         }
-        if (target.is_libcpp_lib_name(lib_name)) {
+        if (target.isLibCxxLibName(lib_name)) {
             if (!comp.config.link_libcpp) return sema.fail(
                 block,
                 src_loc,