Skip to content
Snippets Groups Projects
premake4.lua 2.6 KiB
Newer Older
dg's avatar
dg committed
dofile("build/options.lua")
dg's avatar
dg committed
solution "TEngine"
	configurations { "Debug", "Release" }
	objdir "obj"
dg's avatar
dg committed
	defines {"GLEW_STATIC"}
	if _OPTIONS.force32bits then buildoptions{"-m32"} linkoptions{"-m32"} libdirs{"/usr/lib32"} end
dg's avatar
dg committed

	includedirs {
		"src",
dg's avatar
dg committed
		"src/luasocket",
dg's avatar
dg committed
		"src/fov",
dg's avatar
dg committed
		"src/expat",
		"src/lxp",
dg's avatar
dg committed
		"src/libtcod_import",
dg's avatar
dg committed
		"src/physfs",
dg's avatar
dg committed
		"src/zlib",
dg's avatar
dg committed
		"src/bzip2",
dg's avatar
dg committed
	}
DarkGod's avatar
DarkGod committed
	if _OPTIONS['web-awesomium'] then
		includedirs { "src/web-awesomium" }
	end
	if _OPTIONS['web-cef3'] then
		includedirs { "src/web-cef3" }
	end
	if _OPTIONS.wincross then
		includedirs {
			"/usr/i686-pc-mingw32/usr/include/",
			"/usr/i686-pc-mingw32/usr/include/GL/",
		}
	else
		includedirs {
			"/opt/SDL-2.0/include/SDL2",
			"/usr/include/GL",
		}
	end
dg's avatar
dg committed
	if _OPTIONS.lua == "default" then includedirs{"src/lua"}
	elseif _OPTIONS.lua == "jit2" then includedirs{"src/luajit2/src", "src/luajit2/dynasm",}
	end
dg's avatar
dg committed

DarkGod's avatar
DarkGod committed
if _OPTIONS.steam then
	dofile("steamworks/build/steam-def.lua")
end

DarkGod's avatar
DarkGod committed
configuration "bsd"
	libdirs {
		"/usr/local/lib",
	}
	includedirs {
		"/usr/local/include",
	}

if _OPTIONS.wincross then
dg's avatar
dg committed
configuration "windows"
	libdirs {
		"/Test/xcompile/local//lib",
dg's avatar
dg committed
	}
	includedirs {
		"/Test/xcompile/local/include/SDL2",
		"/Test/xcompile/local/include",
	}
else
configuration "windows"
 	libdirs {
		"/c/code/SDL/lib",
 	}
 	includedirs {
		"/c/code/SDL/include/SDL2",
		"/c/code/SDL/include",
dg's avatar
dg committed
		"/c/mingw2/include/GL",
dg's avatar
dg committed

DarkGod's avatar
DarkGod committed
cppconfig = function(what)
	if os.get() == "macosx" then
		if what == "web" then
			buildoptions { "-stdlib=libstdc++" }
			linkoptions { "-stdlib=libstdc++" }
		else
			buildoptions { "-stdlib=libc++" }
			linkoptions { "-stdlib=libc++" }
		end
	end
DarkGod's avatar
DarkGod committed
	-- links { "stdc++" }
end

configuration "macosx"
	premake.gcc.cc  = 'clang'
	premake.gcc.cxx = 'clang++'

	buildoptions { "-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk", "-mmacosx-version-min=10.7" }
	includedirs {
                        "/Library/Frameworks/SDL2.framework/Headers",
                        "/Library/Frameworks/SDL2_image.framework/Headers",
                        "/Library/Frameworks/SDL2_ttf.framework/Headers",
	}
DarkGod's avatar
DarkGod committed

dg's avatar
dg committed
configuration "Debug"
	defines { }
	flags { "Symbols" }
dg's avatar
dg committed
	buildoptions { "-ggdb" }
DarkGod's avatar
DarkGod committed
--	buildoptions { "-O3" }
dg's avatar
dg committed
	targetdir "bin/Debug"
	if _OPTIONS.luaassert then defines {"LUA_USE_APICHECK"} end
	if _OPTIONS.pedantic then buildoptions { "-Wall" } end
	defines {"TE4_LUA_ALLOW_GENERIC_IO"}
dg's avatar
dg committed

configuration "Release"
	defines { "NDEBUG=1" }
	flags { "Optimize", "NoFramePointer" }
dg's avatar
dg committed
	buildoptions { "-O2" }
dg's avatar
dg committed
	targetdir "bin/Release"

dg's avatar
dg committed

dg's avatar
dg committed
--dofile("build/runner.lua")
dg's avatar
dg committed
dofile("build/te4core.lua")