Skip to content

Commit

Permalink
Merge pull request #5785 from Aurorabili/dev
Browse files Browse the repository at this point in the history
fix: #5777 nvcc warning
  • Loading branch information
waruqi authored Nov 4, 2024
2 parents 6809dd1 + 59f8173 commit eada026
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion xmake/modules/core/tools/nvcc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ function nf_symbol(self, level, opt)
-- debug? generate *.pdb file
local flags = nil
if level == "debug" then
flags = {"-G", "-g", "-lineinfo"}
-- #5777: '--device-debug (-G)' overrides '--generate-line-info (-lineinfo)' in nvcc
-- remove '-G' and '-lineinfo' and add them in mode.debug and mode.profile respectively
flags = {"-g"}
if self:is_plat("windows") then
local host_flags = nil
local symbolfile = nil
Expand Down
9 changes: 9 additions & 0 deletions xmake/rules/mode/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ rule("mode.debug")
if not target:get("optimize") then
target:set("optimize", "none")
end

-- #5777: '--device-debug (-G)' overrides '--generate-line-info (-lineinfo)' in nvcc
target:add("cuflags", "-G")
end
end)

Expand Down Expand Up @@ -98,6 +101,9 @@ rule("mode.releasedbg")
-- enable NDEBUG macros to disables standard-C assertions
target:add("cxflags", "-DNDEBUG")
target:add("cuflags", "-DNDEBUG")

-- #5777: '--device-debug (-G)' overrides '--generate-line-info (-lineinfo)' in nvcc
target:add("cuflags", "-lineinfo")
end
end)

Expand Down Expand Up @@ -158,6 +164,9 @@ rule("mode.profile")
-- enable NDEBUG macros to disables standard-C assertions
target:add("cxflags", "-DNDEBUG")
target:add("cuflags", "-DNDEBUG")

-- #5777: '--device-debug (-G)' overrides '--generate-line-info (-lineinfo)' in nvcc
target:add("cuflags", "-lineinfo")
end
end)

Expand Down

0 comments on commit eada026

Please sign in to comment.