瀏覽代碼

Repaced flagsremove Lua function with new removeflags.

Branimir Karadzic 11 年之前
父節點
當前提交
6b084b6e93
共有 3 個文件被更改,包括 11 次插入17 次删除
  1. 4 0
      scripts/genie.lua
  2. 4 1
      scripts/toolchain.lua
  3. 3 16
      scripts/unittest++.lua

+ 4 - 0
scripts/genie.lua

@@ -40,6 +40,10 @@ project "bx.test"
 
 	debugdir (BX_DIR .. "tests")
 
+	removeflags {
+		"NoExceptions",
+	}
+
 	includedirs {
 		BX_DIR .. "include",
 		BX_THIRD_PARTY_DIR .. "UnitTest++/src/",

+ 4 - 1
scripts/toolchain.lua

@@ -370,7 +370,10 @@ function toolchain(_buildDir, _libDir)
 		objdir (_buildDir .. "win64_" .. _ACTION .. "-clang/obj")
 
 	configuration { "winphone8*" }
-		removeflags { "StaticRuntime", "NoExceptions" }
+		removeflags {
+			"StaticRuntime",
+			"NoExceptions",
+		}
 
 	configuration { "mingw-*" }
 		defines { "WIN32" }

+ 3 - 16
scripts/unittest++.lua

@@ -3,26 +3,13 @@
 -- License: http://www.opensource.org/licenses/BSD-2-Clause
 --
 
-function flagsremove(name)
-	-- bx's toolchain.lua disables exceptions everywhere
-	-- this function can remove some of those flags when
-	-- needed.
-	local container, err = premake.getobject("solution")
-	for _, block in pairs(container["blocks"]) do
-		local tbl = block["flags"]
-		for index, value in pairs(tbl) do
-			if value == name then
-				table.remove(tbl, index)
-			end
-		end
-	end
-end
-
 project "UnitTest++"
 	uuid "ab932f5c-2409-11e3-b000-887628d43830"
 	kind "StaticLib"
 
-	flagsremove("NoExceptions")
+	removeflags {
+		"NoExceptions",
+	}
 
 	files {
 		"../3rdparty/UnitTest++/src/*.cpp",