diff --git a/llvm/utils/gn/build/toolchain/BUILD.gn b/llvm/utils/gn/build/toolchain/BUILD.gn --- a/llvm/utils/gn/build/toolchain/BUILD.gn +++ b/llvm/utils/gn/build/toolchain/BUILD.gn @@ -99,6 +99,10 @@ "Update it, perhaps by running llvm/utils/gn/get.py") } + # Make these apply to all tools below. + lib_switch = "-l" + lib_dir_switch = "-L" + tool("solink") { outfile = "{{output_dir}}/{{target_output_name}}{{output_extension}}" if (current_os == "ios" || current_os == "mac") { @@ -110,7 +114,6 @@ } description = "SOLINK $outfile" outputs = [ outfile ] - lib_switch = "-l" output_prefix = "lib" default_output_dir = "{{root_out_dir}}/lib" } @@ -126,7 +129,6 @@ } description = "SOLINK $outfile" outputs = [ outfile ] - lib_switch = "-l" default_output_dir = "{{root_out_dir}}/lib" } @@ -140,7 +142,6 @@ } description = "LINK $outfile" outputs = [ outfile ] - lib_switch = "-l" # Setting this allows targets to override the default executable output by # setting output_dir. @@ -290,6 +291,10 @@ default_output_dir = "{{root_out_dir}}/lib" } + # Make these apply to all tools below. + lib_switch = "" + lib_dir_switch = "/LIBPATH:" + tool("solink") { outprefix = "{{output_dir}}/{{target_output_name}}" dllfile = "$outprefix{{output_extension}}" @@ -304,7 +309,6 @@ dllfile, libfile, ] - lib_switch = "" default_output_extension = ".dll" restat = true @@ -325,7 +329,6 @@ command = "$link /nologo /dll {{ldflags}} /out:$dllfile /pdb:$pdbfile {{inputs}} {{libs}} " description = "LINK_MODULE $dllfile" outputs = [ dllfile ] - lib_switch = "" runtime_outputs = outputs default_output_extension = ".dll" @@ -339,7 +342,6 @@ command = "$link /nologo {{ldflags}} /out:$outfile /pdb:$pdbfile {{inputs}} {{libs}}" description = "LINK $outfile" outputs = [ outfile ] - lib_switch = "" default_output_extension = ".exe" # Setting this allows targets to override the default executable output by diff --git a/llvm/utils/gn/secondary/llvm/lib/DebugInfo/PDB/BUILD.gn b/llvm/utils/gn/secondary/llvm/lib/DebugInfo/PDB/BUILD.gn --- a/llvm/utils/gn/secondary/llvm/lib/DebugInfo/PDB/BUILD.gn +++ b/llvm/utils/gn/secondary/llvm/lib/DebugInfo/PDB/BUILD.gn @@ -126,19 +126,17 @@ dia_lib_path = "" if (sysroot != "") { - assert(gn_version >= 1937, - "Building with sysroot and DIA requires a newer GN. " + - "Run `python3 llvm\utils\gn\get.py` to update.") include_dirs = [ "$sysroot/DIA SDK/include" ] - dia_lib_path = "$sysroot/DIA SDK/lib/" # x86 .lib file is here. - if (current_cpu == "arm") { - dia_lib_path += "arm/" + dia_lib_path = "$sysroot/DIA SDK/lib" # x86 .lib file is here. + if (current_cpu == "/arm") { + dia_lib_path += "arm" } else if (current_cpu == "arm64") { - dia_lib_path += "arm64/" + dia_lib_path += "/arm64" } else if (current_cpu == "x64") { - dia_lib_path += "amd64/" + dia_lib_path += "/amd64" } + lib_dirs = [ dia_lib_path ] } - libs = [ "${dia_lib_path}diaguids.lib" ] + libs = [ "diaguids.lib" ] } }