Преглед изворни кода

Allow user define BX_CONFIG_*

Cloud Wu пре 5 година
родитељ
комит
7bf14f0bac
1 измењених фајлова са 14 додато и 0 уклоњено
  1. 14 0
      scripts/bx.lua

+ 14 - 0
scripts/bx.lua

@@ -3,6 +3,18 @@
 -- License: https://github.com/bkaradzic/bx#license-bsd-2-clause
 -- License: https://github.com/bkaradzic/bx#license-bsd-2-clause
 --
 --
 
 
+local function userdefines()
+	local defines = {}
+	local BX_CONFIG = os.getenv("BX_CONFIG")
+	if BX_CONFIG then
+		for def in BX_CONFIG:gmatch "[^%s:]+" do
+			table.insert(defines, "BX_CONFIG_" .. def)
+		end
+	end
+
+	return defines
+end
+
 project "bx"
 project "bx"
 	kind "StaticLib"
 	kind "StaticLib"
 
 
@@ -18,6 +30,8 @@ project "bx"
 		path.join(BX_DIR, "scripts/**.natvis"),
 		path.join(BX_DIR, "scripts/**.natvis"),
 	}
 	}
 
 
+	defines (userdefines())
+
 	configuration { "Debug" }
 	configuration { "Debug" }
 		defines {
 		defines {
 			"BX_CONFIG_DEBUG=1",
 			"BX_CONFIG_DEBUG=1",