@@ -31,19 +31,21 @@ rule("platform.windows.subsystem")
3131 if subsystem then
3232 local valid = false
3333 for _ , s in ipairs (subsystems ) do
34- if subsystem :upper ():startwiths (s ) then
34+ if subsystem :upper ():startswith (s ) then
3535 valid = true
3636 break
3737 end
3838 end
3939 assert (valid , " Invalid subsystem " .. subsystem )
4040
41- if target :has_tool (" ld" , " clang" ) then
41+ if target :has_tool (" ld" , " clang" , " clangxx " , " clang_cl " ) then
4242 target :add (" ldflags" , " -Wl,-subsystem:" .. subsystem , { force = true })
4343 elseif target :has_tool (" ld" , " link" , " lld-link" ) then
4444 target :add (" ldflags" , " /SUBSYSTEM:" .. upper (subsystem ), { force = true })
45- elseif target :has_tool (" ld" , " gcc" , " g++ " ) then
45+ elseif target :has_tool (" ld" , " gcc" , " gxx " ) then
4646 target :add (" ldflags" , " -Wl,-m" .. subsystem , { force = true })
47+ elseif target :has_tool (" ld" , " lld" ) then
48+ target :add (" ldflags" , " -subsystem:" .. subsystem , { force = true })
4749 elseif target :has_tool (" ld" , " ld" ) then
4850 target :add (" ldflags" , " -m" .. subsystem , { force = true })
4951 end
0 commit comments