@@ -552,8 +552,6 @@ fn addCmakeCfgOptionsToExe(
552552 addCMakeLibraryList (exe , cfg .clang_libraries );
553553 addCMakeLibraryList (exe , cfg .lld_libraries );
554554 addCMakeLibraryList (exe , cfg .llvm_libraries );
555- addCMakeSystemLibraryList (exe , cfg .clang_system_libraries );
556- addCMakeSystemLibraryList (exe , cfg .llvm_system_libraries );
557555
558556 if (use_zig_libcxx ) {
559557 exe .linkLibCpp ();
@@ -683,29 +681,14 @@ fn addCMakeLibraryList(exe: *std.build.LibExeObjStep, list: []const u8) void {
683681 while (it .next ()) | lib | {
684682 if (mem .startsWith (u8 , lib , "-l" )) {
685683 exe .linkSystemLibrary (lib ["-l" .len .. ]);
684+ } else if (exe .target .isWindows () and mem .endsWith (u8 , lib , ".lib" ) and ! fs .path .isAbsolute (lib )) {
685+ exe .linkSystemLibrary (lib [0 .. lib .len - ".lib" .len ]);
686686 } else {
687687 exe .addObjectFile (lib );
688688 }
689689 }
690690}
691691
692- fn addCMakeSystemLibraryList (exe : * std.build.LibExeObjStep , list : []const u8 ) void {
693- var it = mem .tokenize (u8 , list , ";" );
694- while (it .next ()) | lib | {
695- var start_offset : usize = 0 ;
696- var end_offset : usize = 0 ;
697- if (mem .startsWith (u8 , lib , "-l" )) {
698- start_offset = "-l" .len ;
699- }
700-
701- if (exe .target .isWindows () and mem .endsWith (u8 , lib , ".lib" )) {
702- end_offset = ".lib" .len ;
703- }
704-
705- exe .linkSystemLibrary (lib [start_offset .. lib .len - end_offset ]);
706- }
707- }
708-
709692const CMakeConfig = struct {
710693 llvm_linkage : std.build.LibExeObjStep.Linkage ,
711694 cmake_binary_dir : []const u8 ,
@@ -716,11 +699,9 @@ const CMakeConfig = struct {
716699 lld_include_dir : []const u8 ,
717700 lld_libraries : []const u8 ,
718701 clang_libraries : []const u8 ,
719- clang_system_libraries : []const u8 ,
720702 llvm_lib_dir : []const u8 ,
721703 llvm_include_dir : []const u8 ,
722704 llvm_libraries : []const u8 ,
723- llvm_system_libraries : []const u8 ,
724705 dia_guids_lib : []const u8 ,
725706};
726707
@@ -783,11 +764,9 @@ fn parseConfigH(b: *Builder, config_h_text: []const u8) ?CMakeConfig {
783764 .lld_include_dir = undefined ,
784765 .lld_libraries = undefined ,
785766 .clang_libraries = undefined ,
786- .clang_system_libraries = undefined ,
787767 .llvm_lib_dir = undefined ,
788768 .llvm_include_dir = undefined ,
789769 .llvm_libraries = undefined ,
790- .llvm_system_libraries = undefined ,
791770 .dia_guids_lib = undefined ,
792771 };
793772
@@ -824,18 +803,10 @@ fn parseConfigH(b: *Builder, config_h_text: []const u8) ?CMakeConfig {
824803 .prefix = "#define ZIG_CLANG_LIBRARIES " ,
825804 .field = "clang_libraries" ,
826805 },
827- .{
828- .prefix = "#define ZIG_CLANG_SYSTEM_LIBRARIES " ,
829- .field = "clang_system_libraries" ,
830- },
831806 .{
832807 .prefix = "#define ZIG_LLVM_LIBRARIES " ,
833808 .field = "llvm_libraries" ,
834809 },
835- .{
836- .prefix = "#define ZIG_LLVM_SYSTEM_LIBRARIES " ,
837- .field = "llvm_system_libraries" ,
838- },
839810 .{
840811 .prefix = "#define ZIG_DIA_GUIDS_LIB " ,
841812 .field = "dia_guids_lib" ,
0 commit comments