Skip to content

Commit 52af132

Browse files
committed
fix debug archive
1 parent b65ed4e commit 52af132

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

release.lua

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,18 @@ end
7878
function _reduce_package_size(llvm_archive, unused_libs)
7979
local workdir = "build/.pack"
8080
os.tryrm(workdir)
81+
82+
local archive_name = path.filename(llvm_archive)
83+
print("extract ", archive_name)
8184
archive.extract(llvm_archive, workdir)
8285

83-
for _, lib in ipairs(unused_libs) do
84-
os.rm(path.join(workdir, format("lib/%s.*", lib)))
86+
print("handle ", archive_name)
87+
-- we use dynamic lib for debug mode, and its deps are
88+
-- different with release, so skip them now.
89+
if llvm_archive:find("releasedbg") then
90+
for _, lib in ipairs(unused_libs) do
91+
os.rm(path.join(workdir, format("lib/%s.*", lib)))
92+
end
8593
end
8694

8795
local opt = {}
@@ -100,8 +108,9 @@ function _reduce_package_size(llvm_archive, unused_libs)
100108
end
101109
end
102110

111+
print("archive ", archive_name)
103112
os.mkdir("build/pack")
104-
local archive_file = path.absolute(path.join("build/pack", path.filename(llvm_archive)))
113+
local archive_file = path.absolute(path.join("build/pack", archive_name))
105114
import("utils.archive").archive(archive_file, archive_dirs, opt)
106115
return archive_file
107116
end

0 commit comments

Comments
 (0)