diff options
| author | ruki <[email protected]> | 2018-09-03 15:22:51 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2018-09-03 15:22:51 +0800 |
| commit | da9fbc4a72b996aab4e959fd524c210433aa4add (patch) | |
| tree | a2f201607c06904f67cb92436728ac4287ad4fc5 /xmake/plugins/project/vstudio/impl/vs201x.lua | |
| parent | d8639b6713432cffe9f03bb12d83fc074ac54d7d (diff) | |
| parent | 9ee12112e49db451a49a66d77dd2990d9f6ddab9 (diff) | |
Merge pull request #210 from xigalto/dev
vsproject add some configs to support UNICODE/subsystem
Diffstat (limited to 'xmake/plugins/project/vstudio/impl/vs201x.lua')
| -rw-r--r-- | xmake/plugins/project/vstudio/impl/vs201x.lua | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/xmake/plugins/project/vstudio/impl/vs201x.lua b/xmake/plugins/project/vstudio/impl/vs201x.lua index 8ef5681d2..65c4d1d2a 100644 --- a/xmake/plugins/project/vstudio/impl/vs201x.lua +++ b/xmake/plugins/project/vstudio/impl/vs201x.lua @@ -75,11 +75,15 @@ function _make_targetinfo(mode, arch, target) targetinfo.objectdir = target:objectdir() -- save compiler flags + local firstcompflags=nil targetinfo.compflags = {} - for _, sourcebatch in pairs(target:sourcebatches()) do + for sourcekind, sourcebatch in pairs(target:sourcebatches()) do if not sourcebatch.rulename then for _, sourcefile in ipairs(sourcebatch.sourcefiles) do local compflags = compiler.compflags(sourcefile, {target = target}) + if not firstcompflags and (sourcekind == "cc" or sourcekind == "cxx") then + firstcompflags = compflags + end targetinfo.compflags[sourcefile] = compflags end end @@ -89,6 +93,13 @@ function _make_targetinfo(mode, arch, target) local linkflags = linker.linkflags(target:get("kind"), target:sourcekinds(), {target = target}) targetinfo.linkflags = linkflags + -- set unicode + for _, flag in pairs(firstcompflags) do + if flag:find("[%-|/]DUNICODE") then + targetinfo.unicode = true + end + end + -- ok return targetinfo end |
