diff options
| author | xq114 <[email protected]> | 2022-02-25 19:46:38 +0800 |
|---|---|---|
| committer | xq114 <[email protected]> | 2022-02-25 19:46:38 +0800 |
| commit | 4d36d93be6ab1e4750676645cbd1632ce3ccfccd (patch) | |
| tree | 83773ea3f1a694ed4a315695846854f744f182f8 /xmake/plugins/project/vstudio/impl/vs201x.lua | |
| parent | d1628f8c57ecc60823a5d0b59bf070cddc794443 (diff) | |
finish cuda support for vs generator
Diffstat (limited to 'xmake/plugins/project/vstudio/impl/vs201x.lua')
| -rw-r--r-- | xmake/plugins/project/vstudio/impl/vs201x.lua | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/xmake/plugins/project/vstudio/impl/vs201x.lua b/xmake/plugins/project/vstudio/impl/vs201x.lua index b7186dab5..4983387ae 100644 --- a/xmake/plugins/project/vstudio/impl/vs201x.lua +++ b/xmake/plugins/project/vstudio/impl/vs201x.lua @@ -274,6 +274,9 @@ function _make_targetinfo(mode, arch, target, vcxprojdir) -- save sourcebatches targetinfo.sourcebatches = target:sourcebatches() + -- save sourcekinds + targetinfo.sourcekinds = target:sourcekinds() + -- save target dir targetinfo.targetdir = target:targetdir() @@ -289,7 +292,7 @@ function _make_targetinfo(mode, arch, target, vcxprojdir) if sourcekind then for idx, sourcefile in ipairs(sourcebatch.sourcefiles) do local compflags = compiler.compflags(sourcefile, {target = target}) - if not firstcompflags and (sourcekind == "cc" or sourcekind == "cxx") then + if not firstcompflags and (sourcekind == "cc" or sourcekind == "cxx" or sourcekind == "cu") then firstcompflags = compflags end targetinfo.compflags[sourcefile] = compflags @@ -302,6 +305,15 @@ function _make_targetinfo(mode, arch, target, vcxprojdir) local linkflags = linker.linkflags(target:kind(), target:sourcekinds(), {target = target}) targetinfo.linkflags = linkflags + if table.contains(target:sourcekinds(), "cu") then + -- save cuda linker flags + local linkinst = linker.load("gpucode", "cu", {target = target}) + targetinfo.culinkflags = linkinst:linkflags({target = target}) + + -- save cuda devlink status + targetinfo.cudevlink = target:values("cuda.build.devlink") + end + -- save execution dir (when executed from VS) targetinfo.rundir = target:rundir() |
