diff options
| author | ruki <[email protected]> | 2024-11-04 20:53:05 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-11-04 20:53:05 +0800 |
| commit | eada026c1e27728861f76449b77726b3ebe8bff0 (patch) | |
| tree | ff71cbbbfe0e8336863c10693142d0c2562faf2c | |
| parent | 6809dd1fc95cd38686c9a67a3616519c7d226cfd (diff) | |
| parent | 59f8173e866dfbd2b073a204c6d2b5002b3c6d4e (diff) | |
Merge pull request #5785 from Aurorabili/dev
fix: #5777 nvcc warning
| -rw-r--r-- | xmake/modules/core/tools/nvcc.lua | 4 | ||||
| -rw-r--r-- | xmake/rules/mode/xmake.lua | 9 |
2 files changed, 12 insertions, 1 deletions
diff --git a/xmake/modules/core/tools/nvcc.lua b/xmake/modules/core/tools/nvcc.lua index a7ef324f3..fdb305631 100644 --- a/xmake/modules/core/tools/nvcc.lua +++ b/xmake/modules/core/tools/nvcc.lua @@ -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 diff --git a/xmake/rules/mode/xmake.lua b/xmake/rules/mode/xmake.lua index 8644f60f4..308dec90f 100644 --- a/xmake/rules/mode/xmake.lua +++ b/xmake/rules/mode/xmake.lua @@ -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) @@ -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) @@ -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) |
