summaryrefslogtreecommitdiff
path: root/xmake/modules/detect/tools/cl/cfeatures.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2017-07-07 21:45:43 +0800
committerruki <[email protected]>2017-07-07 21:45:43 +0800
commitcc484e28d357f9b65358001c10a6cd95190e684e (patch)
treee8342e43109ce5a16a0c47953472a783e9e0b3fe /xmake/modules/detect/tools/cl/cfeatures.lua
parent417aa9a8fce9eb8f0908a2e580bb6b15d2a4ab8f (diff)
add features for msvc
Diffstat (limited to 'xmake/modules/detect/tools/cl/cfeatures.lua')
-rw-r--r--xmake/modules/detect/tools/cl/cfeatures.lua12
1 files changed, 9 insertions, 3 deletions
diff --git a/xmake/modules/detect/tools/cl/cfeatures.lua b/xmake/modules/detect/tools/cl/cfeatures.lua
index 5a4998f84..2c953a00b 100644
--- a/xmake/modules/detect/tools/cl/cfeatures.lua
+++ b/xmake/modules/detect/tools/cl/cfeatures.lua
@@ -31,10 +31,16 @@ end
-- get features
function main()
- -- TODO
+ -- init conditions
+ local msvc_minver = "_MSC_VER >= 1200"
+ local msvc_2005 = "_MSC_VER >= 1400"
+ local msvc_2010 = "_MSC_VER >= 1600"
+
-- set features
- _set("c_static_assert", "defined(_WIN32)")
- _set("c_restrict", "defined(_MSC_VER)")
+ _set("c_static_assert", msvc_2010)
+ _set("c_restrict", msvc_2005)
+ _set("c_variadic_macros", msvc_2005)
+ _set("c_function_prototypes", msvc_minver)
-- get features
return _g.features