From 3773b77568b062a0df51df7d2b61f8140f2c804b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Mon, 20 Oct 2014 20:45:18 -0700 Subject: [PATCH] Added VS clang toolset. --- scripts/toolchain.lua | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/scripts/toolchain.lua b/scripts/toolchain.lua index 78e6328..a53b457 100755 --- a/scripts/toolchain.lua +++ b/scripts/toolchain.lua @@ -33,6 +33,17 @@ function toolchain(_buildDir, _libDir) }, } + newoption { + trigger = "vs", + value = "toolset", + description = "Choose VS toolset", + allowed = { + { "vs2012-clang", "Clang 3.6" }, + { "vs2013-clang", "Clang 3.6" }, + { "winphone8", "Windows Phone 8.0" }, + }, + } + newoption { trigger = "with-android", value = "#", @@ -244,6 +255,17 @@ function toolchain(_buildDir, _libDir) if "rpi" == _OPTIONS["gcc"] then location (_buildDir .. "projects/" .. _ACTION .. "-rpi") end + elseif _ACTION == "vs2012" or _ACTION == "vs2013" then + + if (_ACTION .. "-clang") == _OPTIONS["vs"] then + premake.vstudio.toolset = ("LLVM-" .. _ACTION) + location (_buildDir .. "projects/" .. _ACTION .. "-clang") + end + + if "winphone8" == _OPTIONS["vs"] then + premake.vstudio.toolset = "v120_wp81" + location (_buildDir .. "projects/" .. _ACTION .. "-winphone8") + end end flags { @@ -317,6 +339,19 @@ function toolchain(_buildDir, _libDir) "$(DXSDK_DIR)/lib/x64", } + configuration { "vs*-clang" } + buildoptions { + "-Qunused-arguments", + } + + configuration { "x32", "vs*-clang" } + targetdir (_buildDir .. "win32_" .. _ACTION .. "-clang/bin") + objdir (_buildDir .. "win32_" .. _ACTION .. "-clang/obj") + + configuration { "x64", "vs*-clang" } + targetdir (_buildDir .. "win64_" .. _ACTION .. "-clang/bin") + objdir (_buildDir .. "win64_" .. _ACTION .. "-clang/obj") + configuration { "mingw-*" } defines { "WIN32" } includedirs { bxDir .. "include/compat/mingw" }