Pārlūkot izejas kodu

Reorganized premake scripts.

bkaradzic 13 gadi atpakaļ
vecāks
revīzija
c4dba2b40b
6 mainītis faili ar 190 papildinājumiem un 166 dzēšanām
  1. 40 0
      premake/bgfx.lua
  2. 18 0
      premake/ddsdump.lua
  3. 28 0
      premake/helloworld.lua
  4. 14 0
      premake/makedisttex.lua
  5. 36 166
      premake/premake4.lua
  6. 54 0
      premake/shaderc.lua

+ 40 - 0
premake/bgfx.lua

@@ -0,0 +1,40 @@
+project "bgfx"
+	uuid "2dc7fd80-ed76-11e0-be50-0800200c9a66"
+	kind "StaticLib"
+
+	includedirs {
+		BGFX_DIR .. "../bx/include",
+	}
+
+	configuration { "nacl" }
+		buildoptions {
+			"-Wall",
+		}
+	
+	configuration { "windows" }
+		includedirs {
+			BGFX_DIR .. "3rdparty/glext",
+		}
+
+		defines {
+--			"BGFX_CONFIG_RENDERER_OPENGL=1",
+		}
+
+	configuration "Debug"
+		defines {
+			"BGFX_CONFIG_DEBUG=1",
+		}
+
+	configuration {}
+
+	includedirs {
+		BGFX_DIR .. "include",
+	}
+
+	files {
+		BGFX_DIR .. "include/**.h",
+		BGFX_DIR .. "src/**.cpp",
+		BGFX_DIR .. "src/**.h",
+	}
+
+--	copyLib()

+ 18 - 0
premake/ddsdump.lua

@@ -0,0 +1,18 @@
+project "ddsdump"
+	uuid "838801ee-7bc3-11e1-9f19-eae7d36e7d26"
+	kind "ConsoleApp"
+
+	includedirs {
+		BGFX_DIR .. "../bx/include",
+		BGFX_DIR .. "include",
+		BGFX_DIR .. "src",
+	}
+
+	files {
+		BGFX_DIR .. "src/dds.*",
+		BGFX_DIR .. "tools/ddsdump.cpp",
+	}
+
+	links {
+		"bgfx",
+	}

+ 28 - 0
premake/helloworld.lua

@@ -0,0 +1,28 @@
+project "helloworld"
+	uuid "ff2c8450-ebf4-11e0-9572-0800200c9a66"
+	kind "WindowedApp"
+
+	includedirs {
+		BGFX_DIR .. "../bx/include",
+		BGFX_DIR .. "include",
+	}
+
+	files {
+		BGFX_DIR .. "examples/common/**.cpp",
+		BGFX_DIR .. "examples/common/**.h",
+		BGFX_DIR .. "examples/helloworld/**.cpp",
+		BGFX_DIR .. "examples/helloworld/**.h",
+	}
+
+	links {
+		"bgfx",
+	}
+
+	configuration { "nacl" }
+		targetextension ".nexe"
+
+	configuration { "nacl", "Release" }
+		postbuildcommands {
+			"@echo Stripping symbols.",
+			"@$(NACL)/bin/x86_64-nacl-strip -s \"$(TARGET)\""
+		}

+ 14 - 0
premake/makedisttex.lua

@@ -0,0 +1,14 @@
+project "makedisttex"
+	uuid "b0561b30-91bb-11e1-b06e-023ad46e7d26"
+	kind "ConsoleApp"
+
+	includedirs {
+		BGFX_DIR .. "../bx/include",
+		BGFX_DIR .. "3rdparty/edtaa3",
+		BGFX_DIR .. "3rdparty/stb_image",
+	}
+
+	files {
+		BGFX_DIR .. "3rdparty/edtaa3/**",
+		BGFX_DIR .. "tools/makedisttex.cpp",
+	}

+ 36 - 166
premake/premake4.lua

@@ -30,14 +30,14 @@ newoption {
 -- Avoid error when invoking premake4 --help.
 -- Avoid error when invoking premake4 --help.
 if (_ACTION == nil) then return end
 if (_ACTION == nil) then return end
 
 
-ROOT_DIR = (path.getabsolute("..") .. "/")
-BUILD_DIR = (ROOT_DIR .. ".build/")
-THIRD_PARTY_DIR = (ROOT_DIR .. "3rdparty/")
+BGFX_DIR = (path.getabsolute("..") .. "/")
+local BGFX_BUILD_DIR = (BGFX_DIR .. ".build/")
+local BGFX_THIRD_PARTY_DIR = (BGFX_DIR .. "3rdparty/")
 
 
 local XEDK = os.getenv("XEDK")
 local XEDK = os.getenv("XEDK")
 if not XEDK then XEDK = "<you must install XBOX SDK>" end
 if not XEDK then XEDK = "<you must install XBOX SDK>" end
 
 
-location (BUILD_DIR .. "projects/" .. _ACTION)
+location (BGFX_BUILD_DIR .. "projects/" .. _ACTION)
 
 
 if _ACTION == "gmake" then
 if _ACTION == "gmake" then
 
 
@@ -65,7 +65,7 @@ if _ACTION == "gmake" then
 		premake.gcc.cc = "$(NACL)/bin/x86_64-nacl-gcc"
 		premake.gcc.cc = "$(NACL)/bin/x86_64-nacl-gcc"
 		premake.gcc.cxx = "$(NACL)/bin/x86_64-nacl-g++"
 		premake.gcc.cxx = "$(NACL)/bin/x86_64-nacl-g++"
 		premake.gcc.ar = "$(NACL)/bin/x86_64-nacl-ar"
 		premake.gcc.ar = "$(NACL)/bin/x86_64-nacl-ar"
-		location (BUILD_DIR .. "projects/" .. _ACTION .. "-nacl")
+		location (BGFX_BUILD_DIR .. "projects/" .. _ACTION .. "-nacl")
 	end
 	end
 end
 end
 
 
@@ -80,10 +80,6 @@ flags {
 	"Symbols",
 	"Symbols",
 }
 }
 
 
-includedirs {
-	ROOT_DIR .. "../bx/include",
-}
-
 configuration "Debug"
 configuration "Debug"
 	targetsuffix "Debug"
 	targetsuffix "Debug"
 
 
@@ -107,27 +103,27 @@ configuration { "vs*" }
 
 
 configuration { "x32", "vs*" }
 configuration { "x32", "vs*" }
 	defines { "WIN32" }
 	defines { "WIN32" }
-	targetdir (BUILD_DIR .. "win32_" .. _ACTION .. "/bin")
-	objdir (BUILD_DIR .. "win32_" .. _ACTION .. "/obj")
-	includedirs { THIRD_PARTY_DIR .. "compiler/msvc" }
+	targetdir (BGFX_BUILD_DIR .. "win32_" .. _ACTION .. "/bin")
+	objdir (BGFX_BUILD_DIR .. "win32_" .. _ACTION .. "/obj")
+	includedirs { BGFX_THIRD_PARTY_DIR .. "compiler/msvc" }
 
 
 configuration { "x64", "vs*" }
 configuration { "x64", "vs*" }
 	defines { "WIN32" }
 	defines { "WIN32" }
-	targetdir (BUILD_DIR .. "win64_" .. _ACTION .. "/bin")
-	objdir (BUILD_DIR .. "win64_" .. _ACTION .. "/obj")
-	includedirs { THIRD_PARTY_DIR .. "compiler/msvc" }
+	targetdir (BGFX_BUILD_DIR .. "win64_" .. _ACTION .. "/bin")
+	objdir (BGFX_BUILD_DIR .. "win64_" .. _ACTION .. "/obj")
+	includedirs { BGFX_THIRD_PARTY_DIR .. "compiler/msvc" }
 
 
 configuration { "x32", "mingw" }
 configuration { "x32", "mingw" }
 	defines { "WIN32" }
 	defines { "WIN32" }
-	targetdir (BUILD_DIR .. "win32_mingw" .. "/bin")
-	objdir (BUILD_DIR .. "win32_mingw" .. "/obj")
-	includedirs { THIRD_PARTY_DIR .. "compiler/mingw" }
+	targetdir (BGFX_BUILD_DIR .. "win32_mingw" .. "/bin")
+	objdir (BGFX_BUILD_DIR .. "win32_mingw" .. "/obj")
+	includedirs { BGFX_THIRD_PARTY_DIR .. "compiler/mingw" }
 
 
 configuration { "x64", "mingw" }
 configuration { "x64", "mingw" }
 	defines { "WIN32" }
 	defines { "WIN32" }
-	targetdir (BUILD_DIR .. "win64_mingw" .. "/bin")
-	objdir (BUILD_DIR .. "win64_mingw" .. "/obj")
-	includedirs { THIRD_PARTY_DIR .. "compiler/mingw" }
+	targetdir (BGFX_BUILD_DIR .. "win64_mingw" .. "/bin")
+	objdir (BGFX_BUILD_DIR .. "win64_mingw" .. "/obj")
+	includedirs { BGFX_THIRD_PARTY_DIR .. "compiler/mingw" }
 
 
 configuration { "nacl" }
 configuration { "nacl" }
 	defines { "_BSD_SOURCE=1", "_POSIX_C_SOURCE=199506", "_XOPEN_SOURCE=600" }
 	defines { "_BSD_SOURCE=1", "_POSIX_C_SOURCE=199506", "_XOPEN_SOURCE=600" }
@@ -135,7 +131,7 @@ configuration { "nacl" }
 		"ppapi",
 		"ppapi",
 		"ppapi_gles2",
 		"ppapi_gles2",
 	}
 	}
-	includedirs { THIRD_PARTY_DIR .. "compiler/nacl" }
+	includedirs { BGFX_THIRD_PARTY_DIR .. "compiler/nacl" }
 	buildoptions {
 	buildoptions {
 		"-std=c++0x",
 		"-std=c++0x",
 		"-U__STRICT_ANSI__",
 		"-U__STRICT_ANSI__",
@@ -154,165 +150,39 @@ configuration { "nacl" }
 	}
 	}
 
 
 configuration { "x32", "nacl" }
 configuration { "x32", "nacl" }
-	targetdir (BUILD_DIR .. "nacl-x86" .. "/bin")
-	objdir (BUILD_DIR .. "nacl-x86" .. "/obj")
-	libdirs { THIRD_PARTY_DIR .. "lib/nacl-x86" }
+	targetdir (BGFX_BUILD_DIR .. "nacl-x86" .. "/bin")
+	objdir (BGFX_BUILD_DIR .. "nacl-x86" .. "/obj")
+	libdirs { BGFX_THIRD_PARTY_DIR .. "lib/nacl-x86" }
 	linkoptions {
 	linkoptions {
 		"-melf32_nacl",
 		"-melf32_nacl",
 	}
 	}
 
 
 configuration { "x64", "nacl" }
 configuration { "x64", "nacl" }
-	targetdir (BUILD_DIR .. "nacl-x64" .. "/bin")
-	objdir (BUILD_DIR .. "nacl-x64" .. "/obj")
-	libdirs { THIRD_PARTY_DIR .. "lib/nacl-x64" }
+	targetdir (BGFX_BUILD_DIR .. "nacl-x64" .. "/bin")
+	objdir (BGFX_BUILD_DIR .. "nacl-x64" .. "/obj")
+	libdirs { BGFX_THIRD_PARTY_DIR .. "lib/nacl-x64" }
 	linkoptions {
 	linkoptions {
 		"-melf64_nacl",
 		"-melf64_nacl",
 	}
 	}
 
 
 configuration { "x32", "linux" }
 configuration { "x32", "linux" }
-	targetdir (BUILD_DIR .. "linux32" .. "/bin")
-	objdir (BUILD_DIR .. "linux32" .. "/obj")
+	targetdir (BGFX_BUILD_DIR .. "linux32" .. "/bin")
+	objdir (BGFX_BUILD_DIR .. "linux32" .. "/obj")
 
 
 configuration { "x64", "linux" }
 configuration { "x64", "linux" }
-	targetdir (BUILD_DIR .. "linux64" .. "/bin")
-	objdir (BUILD_DIR .. "linux64" .. "/obj")
+	targetdir (BGFX_BUILD_DIR .. "linux64" .. "/bin")
+	objdir (BGFX_BUILD_DIR .. "linux64" .. "/obj")
 
 
 configuration { "Xbox360" }
 configuration { "Xbox360" }
 	defines { "_XBOX", "NOMINMAX" }
 	defines { "_XBOX", "NOMINMAX" }
-	targetdir (BUILD_DIR .. "xbox360" .. "/bin")
-	objdir (BUILD_DIR .. "xbox360" .. "/obj")
-	includedirs { THIRD_PARTY_DIR .. "compiler/msvc" }
+	targetdir (BGFX_BUILD_DIR .. "xbox360" .. "/bin")
+	objdir (BGFX_BUILD_DIR .. "xbox360" .. "/obj")
+	includedirs { BGFX_THIRD_PARTY_DIR .. "compiler/msvc" }
 
 
 configuration {} -- reset configuration
 configuration {} -- reset configuration
 
 
-project "bgfx"
-	uuid "f4c51860-ebf4-11e0-9572-0800200c9a66"
-	kind "StaticLib"
-
-	includedirs {
-		"../include",
-		ROOT_DIR .. "../bx/include",
-		THIRD_PARTY_DIR .. "glew-1.5.4/include",
-	}
-
-	files {
-		"../include/**.h",
-		"../src/**.cpp",
-		"../src/**.h",
-	}
-
-project "shaderc"
-	uuid "f3cd2e90-52a4-11e1-b86c-0800200c9a66"
-	kind "ConsoleApp"
-
-	local GLSL_OPTIMIZER = (THIRD_PARTY_DIR .. "glsl-optimizer/")
-
-	configuration { "vs*" }
-		includedirs { GLSL_OPTIMIZER .. "src/glsl/msvc" }
-
-	configuration {}
-
-	includedirs {
-		ROOT_DIR .. "../bx/include",
-
-		THIRD_PARTY_DIR .. "fcpp",
-
-		GLSL_OPTIMIZER .. "include",
-		GLSL_OPTIMIZER .. "include/c99",
-		GLSL_OPTIMIZER .. "src/mesa",
-		GLSL_OPTIMIZER .. "src/mapi",
-		GLSL_OPTIMIZER .. "src/glsl",
-	}
-
-	files {
-		ROOT_DIR .. "tools/shaderc.cpp",
-		THIRD_PARTY_DIR .. "fcpp/**.h",
-		THIRD_PARTY_DIR .. "fcpp/cpp1.c",
-		THIRD_PARTY_DIR .. "fcpp/cpp2.c",
-		THIRD_PARTY_DIR .. "fcpp/cpp3.c",
-		THIRD_PARTY_DIR .. "fcpp/cpp4.c",
-		THIRD_PARTY_DIR .. "fcpp/cpp5.c",
-		THIRD_PARTY_DIR .. "fcpp/cpp6.c",
-		THIRD_PARTY_DIR .. "fcpp/cpp6.c",
-
-		GLSL_OPTIMIZER .. "src/mesa/**.c",
-		GLSL_OPTIMIZER .. "src/glsl/**.cpp",
-		GLSL_OPTIMIZER .. "src/mesa/**.h",
-		GLSL_OPTIMIZER .. "src/glsl/**.c",
-		GLSL_OPTIMIZER .. "src/glsl/**.cpp",
-		GLSL_OPTIMIZER .. "src/glsl/**.h",
-	}
-
-	excludes {
-		GLSL_OPTIMIZER .. "src/glsl/glcpp/glcpp.c",
-		GLSL_OPTIMIZER .. "src/glsl/glcpp/tests/**",
-		GLSL_OPTIMIZER .. "src/glsl/main.cpp",
-		GLSL_OPTIMIZER .. "src/glsl/builtin_stubs.cpp",
-	}
-
-	links {
-		"d3dx9",
-	}
-
-project "ddsdump"
-	uuid "838801ee-7bc3-11e1-9f19-eae7d36e7d26"
-	kind "ConsoleApp"
-
-	includedirs {
-		ROOT_DIR .. "../bx/include",
-		ROOT_DIR .. "include",
-		ROOT_DIR .. "src",
-	}
-
-	files {
-		ROOT_DIR .. "src/dds.*",
-		ROOT_DIR .. "tools/ddsdump.cpp",
-	}
-
-	links {
-		"bgfx",
-	}
-
-project "makedisttex"
-	uuid "b0561b30-91bb-11e1-b06e-023ad46e7d26"
-	kind "ConsoleApp"
-
-	includedirs {
-		ROOT_DIR .. "../bx/include",
-		THIRD_PARTY_DIR .. "edtaa3",
-		THIRD_PARTY_DIR .. "stb_image",
-	}
-
-	files {
-		THIRD_PARTY_DIR .. "edtaa3/**",
-		ROOT_DIR .. "tools/makedisttex.cpp",
-	}
-
-project "helloworld"
-	uuid "ff2c8450-ebf4-11e0-9572-0800200c9a66"
-	kind "WindowedApp"
-
-	includedirs {
-		ROOT_DIR .. "include",
-	}
-
-	files {
-		ROOT_DIR .. "examples/common/**.cpp",
-		ROOT_DIR .. "examples/common/**.h",
-		ROOT_DIR .. "examples/helloworld/**.cpp",
-		ROOT_DIR .. "examples/helloworld/**.h",
-	}
-
-	links {
-		"bgfx",
-	}
-
-	configuration { "nacl" }
-		targetextension ".nexe"
-
-	configuration { "nacl", "Release" }
-		postbuildcommands {
-			"@echo Stripping symbols.",
-			"@$(NACL)/bin/x86_64-nacl-strip -s \"$(TARGET)\""
-		}
-
+dofile "bgfx.lua"
+dofile "ddsdump.lua"
+dofile "helloworld.lua"
+dofile "makedisttex.lua"
+dofile "shaderc.lua"

+ 54 - 0
premake/shaderc.lua

@@ -0,0 +1,54 @@
+project "shaderc"
+	uuid "f3cd2e90-52a4-11e1-b86c-0800200c9a66"
+	kind "ConsoleApp"
+
+	local GLSL_OPTIMIZER = (BGFX_DIR .. "3rdparty/glsl-optimizer/")
+
+	configuration { "vs*" }
+		includedirs {
+			GLSL_OPTIMIZER .. "src/glsl/msvc",
+		}
+
+	configuration {}
+
+	includedirs {
+		BGFX_DIR .. "../bx/include",
+
+		BGFX_DIR .. "3rdparty/fcpp",
+
+		GLSL_OPTIMIZER .. "include",
+		GLSL_OPTIMIZER .. "include/c99",
+		GLSL_OPTIMIZER .. "src/mesa",
+		GLSL_OPTIMIZER .. "src/mapi",
+		GLSL_OPTIMIZER .. "src/glsl",
+	}
+
+	files {
+		BGFX_DIR .. "3rdparty/tools/shaderc.cpp",
+		BGFX_DIR .. "3rdparty/fcpp/**.h",
+		BGFX_DIR .. "3rdparty/fcpp/cpp1.c",
+		BGFX_DIR .. "3rdparty/fcpp/cpp2.c",
+		BGFX_DIR .. "3rdparty/fcpp/cpp3.c",
+		BGFX_DIR .. "3rdparty/fcpp/cpp4.c",
+		BGFX_DIR .. "3rdparty/fcpp/cpp5.c",
+		BGFX_DIR .. "3rdparty/fcpp/cpp6.c",
+		BGFX_DIR .. "3rdparty/fcpp/cpp6.c",
+
+		GLSL_OPTIMIZER .. "src/mesa/**.c",
+		GLSL_OPTIMIZER .. "src/glsl/**.cpp",
+		GLSL_OPTIMIZER .. "src/mesa/**.h",
+		GLSL_OPTIMIZER .. "src/glsl/**.c",
+		GLSL_OPTIMIZER .. "src/glsl/**.cpp",
+		GLSL_OPTIMIZER .. "src/glsl/**.h",
+	}
+
+	excludes {
+		GLSL_OPTIMIZER .. "src/glsl/glcpp/glcpp.c",
+		GLSL_OPTIMIZER .. "src/glsl/glcpp/tests/**",
+		GLSL_OPTIMIZER .. "src/glsl/main.cpp",
+		GLSL_OPTIMIZER .. "src/glsl/builtin_stubs.cpp",
+	}
+
+	links {
+		"d3dx9",
+	}