Skip to content

Commit f3a0328

Browse files
committed
fix lto flags
1 parent 5b4f98d commit f3a0328

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

xmake.lua

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,16 +253,17 @@ rule("clice_build_config", function()
253253
target:add("ldflags", "-fuse-ld=lld", "-static-libstdc++", "-Wl,--gc-sections")
254254
elseif target:is_plat("macosx") then
255255
target:add("ldflags", "-fuse-ld=lld", "-Wl,-dead_strip,-object_path_lto,clice.lto.o", { force = true })
256-
if has_config("release") then
257-
-- pixi clang failed to add lto flags because it need `-fuse-ld=lld`
258-
target:add("ldflags", "-flto=thin", { force = true })
259-
end
260256
-- dsymutil so slow, disable it in dev ci
261257
if not has_config("release") and is_mode("releasedbg") and has_config("ci") then
262258
target:rule_enable("utils.symbols.extract", false)
263259
end
264260
end
265261

262+
if has_config("release") then
263+
-- pixi clang failed to add lto flags because it need `-fuse-ld=lld`
264+
target:add("ldflags", "-flto=thin", { force = true })
265+
end
266+
266267
if has_config("ci") then
267268
target:add("cxxflags", "-DCLICE_CI_ENVIRONMENT=1")
268269
end

0 commit comments

Comments
 (0)