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

This commit is contained in:
Alex Rønne Petersen 2024-10-08 06:42:42 +02:00
parent 482759079f
commit c76a98f28a
No known key found for this signature in database
5 changed files with 10 additions and 10 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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

View File

@ -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,

View File

@ -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;
}