This commit is contained in:
David Gonzalez Martin 2024-03-27 23:46:47 -06:00
parent 12fe8d9fd8
commit c1ec772654
6 changed files with 41 additions and 53 deletions

View File

@ -314,17 +314,10 @@ pub fn compileCSourceFile(context: *const Context, arguments: []const []const u8
if (data_structures.last_byte(argument, '.')) |dot_index| {
const extension_string = argument[dot_index..];
const extension: Extension =
if (byte_equal(extension_string, ".c")) .c
else if (byte_equal(extension_string, ".cpp") or byte_equal(extension_string, ".cxx") or byte_equal(extension_string, ".cc")) .cpp
else if (byte_equal(extension_string, ".S")) .assembly
else if (byte_equal(extension_string, ".o")) .object
else if (byte_equal(extension_string, ".a")) .static_library
else if (byte_equal(extension_string, ".so") or
if (byte_equal(extension_string, ".c")) .c else if (byte_equal(extension_string, ".cpp") or byte_equal(extension_string, ".cxx") or byte_equal(extension_string, ".cc")) .cpp else if (byte_equal(extension_string, ".S")) .assembly else if (byte_equal(extension_string, ".o")) .object else if (byte_equal(extension_string, ".a")) .static_library else if (byte_equal(extension_string, ".so") or
byte_equal(extension_string, ".dll") or
byte_equal(extension_string, ".dylib") or
byte_equal(extension_string, ".tbd")
) .shared_library
else {
byte_equal(extension_string, ".tbd")) .shared_library else {
try write(.panic, argument);
try write(.panic, "\n");
@panic("Unable to recognize extension for the file above");
@ -533,15 +526,13 @@ pub fn compileCSourceFile(context: *const Context, arguments: []const []const u8
try argv.append(context.my_allocator, "-fno-builtin");
}
if (link_libcpp) {
// include paths
}
const link_libc = c_source_file.extension == .c;
if (link_libc) {
}
if (link_libc) {}
const link_libunwind = false;
if (link_libunwind) {

View File

@ -80,7 +80,6 @@ pub fn link(context: *const Compilation.Context, options: linker.Options) !void
else => @compileError("OS not supported"),
}
for (options.libraries) |lib| {
try argv.append(context.my_allocator, try std.mem.concat(context.allocator, u8, &.{ "-l", lib.path }));
}

View File

@ -413,9 +413,7 @@ fn runCmakeTests(allocator: Allocator, dir_path: []const u8) !void {
const ninja = try std.ChildProcess.run(.{
.allocator = allocator,
// TODO: delete -main_source_file?
.argv = &.{
"ninja"
},
.argv = &.{"ninja"},
.max_output_bytes = std.math.maxInt(u64),
});
const ninja_result: TestError!bool = switch (ninja.term) {