提交 d699e840 编写于 作者: J jady3356 提交者: Gitee

Add strip for release.

上级 871e7529
......@@ -62,33 +62,54 @@ template("clang_toolchain") {
}
tool("solink") {
outfile = "{{output_dir}}/{{target_output_name}}{{output_extension}}"
stripped_outfile = outfile
rspfile = "$outfile.rsp"
rspfile_content = "{{inputs}}"
command = "$ld -shared {{ldflags}} {{inputs}} {{libs}} -o $outfile"
command = ""
if (need_strip) {
unstripped_outfile = outfile
command += " && $strip" + " \"$unstripped_outfile\" \"$outfile\""
stripped_outfile = "{{output_dir}}/usr/lib/stripped/{{target_output_name}}{{output_extension}}"
command += "mkdir -p {{output_dir}}/usr/lib/stripped && "
}
command += "$ld -shared {{ldflags}} {{inputs}} {{libs}} -o $outfile"
if (need_strip) {
command += " && $strip \"$outfile\" \"$stripped_outfile\""
}
default_output_extension = ".so"
description = "SOLINK $outfile"
default_output_dir = "{{root_out_dir}}"
output_prefix = "lib"
outputs = [ outfile ]
if (stripped_outfile != outfile) {
outputs += [ stripped_outfile ]
}
}
tool("link") {
outfile = "{{output_dir}}/bin/{{target_output_name}}{{output_extension}}"
stripped_outfile = outfile
rspfile = "$outfile.rsp"
custom_ld_flags = " "
command =
command = ""
if (need_strip) {
stripped_outfile = "{{output_dir}}/bin/stripped/{{target_output_name}}{{output_extension}}"
command += "mkdir -p {{output_dir}}/bin/stripped && "
}
command +=
"$cc {{ldflags}} {{inputs}} {{libs}} $custom_ld_flags -o $outfile"
if (need_strip) {
command += " && $strip $outfile"
command += " && $strip \"$outfile\" \"$stripped_outfile\""
}
description = "LLVM LINK $outfile"
default_output_dir = "{{root_out_dir}}"
rspfile_content = "{{inputs}}"
outputs = [ outfile ]
if (stripped_outfile != outfile) {
outputs += [ stripped_outfile ]
}
}
tool("stamp") {
if (host_os == "win") {
......
......@@ -73,35 +73,54 @@ template("gcc_toolchain") {
}
tool("solink") {
outfile = "{{output_dir}}/{{target_output_name}}{{output_extension}}"
rspfile = "{{output}}.rsp"
stripped_outfile = outfile
rspfile = "$outfile.rsp"
rspfile_content = "{{inputs}}"
command =
command = ""
if (need_strip) {
stripped_outfile = "{{output_dir}}/usr/lib/stripped/{{target_output_name}}{{output_extension}}"
command += "mkdir -p {{output_dir}}/usr/lib/stripped && "
}
command +=
"$ld -shared {{ldflags}} $extra_ldflags " +
"-Wl,--start-group {{inputs}} {{libs}} -Wl,--end-group -o $outfile"
if (need_strip) {
command += "&& $strip $outfile"
command += " && $strip \"$outfile\" -o \"$stripped_outfile\""
}
description = "SOLINK $outfile"
outputs = [ outfile ]
if (stripped_outfile != outfile) {
outputs += [ stripped_outfile ]
}
default_output_dir = "{{root_out_dir}}"
default_output_extension = ".so"
output_prefix = "lib"
}
tool("link") {
outfile = "{{output_dir}}/bin/{{target_output_name}}{{output_extension}}"
stripped_outfile = outfile
rspfile = "$outfile.rsp"
command =
command = ""
if (need_strip) {
stripped_outfile = "{{output_dir}}/bin/stripped/{{target_output_name}}{{output_extension}}"
command += "mkdir -p {{output_dir}}/bin/stripped && "
}
command +=
"$ld {{ldflags}} $extra_ldflags " +
"-Wl,--start-group {{inputs}} {{libs}} -Wl,--end-group -o $outfile "
if (need_strip) {
command += "&& $strip $outfile"
command += " && $strip \"$outfile\" -o \"$stripped_outfile\""
}
description = "LINK $outfile"
default_output_dir = "{{root_out_dir}}"
rspfile_content = "{{inputs}}"
outputs = [ outfile ]
if (stripped_outfile != outfile) {
outputs += [ stripped_outfile ]
}
}
tool("stamp") {
if (host_os == "win") {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册