dofile( "inc/include.lua" )

solution "GWEN"

	language "C++"
	location ( os.get() .. "/" .. _ACTION )
	flags { "Unicode", "Symbols", "NoEditAndContinue", "NoPCH",
            "No64BitChecks", "StaticRuntime", "EnableSSE" } -- "NoRTTI"
	targetdir ( "../lib/" .. os.get() .. "/" .. _ACTION )
	libdirs { "../lib/", "../lib/" .. os.get() }

	configurations
	{
		"Release",
		"Debug"
	}

	if ( _ACTION == "vs2010" or _ACTION=="vs2008" ) then
		-- Enable multiprocessor compilation (requires Minimal Rebuild to be disabled)
		buildoptions { "/MP"  }
		flags { "NoMinimalRebuild" }
	end



configuration "Release"
	defines { "NDEBUG" }
	flags{ "Optimize", "FloatFast" }
	includedirs { "../include/" }

configuration "Debug"
	defines { "_DEBUG" }
	includedirs { "../include/" }
	targetsuffix( "d" )

project "GWEN-DLL"
	defines { "GWEN_COMPILE_DLL" }
	files { "../src/**.*", "../include/Gwen/**.*" }
	kind "SharedLib"
	targetname( "gwen" )

project "GWEN-Static"
	defines { "GWEN_COMPILE_STATIC" }
	files { "../src/**.*", "../include/Gwen/**.*" }
	flags { "Symbols" }
	kind "StaticLib"
	targetname( "gwen_static" )

project "UnitTest"
	files { "../UnitTest/**.*" }
	flags { "Symbols" }
	kind "StaticLib"
	targetname( "unittest" )

--
-- Renderers
--

DefineRenderer( "OpenGL",
                {"../Renderers/OpenGL/OpenGL.cpp"} )

DefineRenderer( "OpenGL_DebugFont",
                { "../Renderers/OpenGL/OpenGL.cpp",
                  "../Renderers/OpenGL/DebugFont/OpenGL_DebugFont.cpp" } )

DefineRenderer( "SFML",
                { "../Renderers/SFML/SFML.cpp" },
                SFML_DEFINES )

DefineRenderer( "SFML2",
                { "../Renderers/SFML2/SFML2.cpp" },
                SFML2_DEFINES )

DefineRenderer( "Allegro",
                { "../Renderers/Allegro/Allegro.cpp" } )

if ( os.get() == "windows" ) then
	DefineRenderer( "DirectX9",
                    { "../Renderers/DirectX9/DirectX9.cpp" } )
	includedirs { "$(DXSDK_DIR)/Include" }
	libdirs { "$(DXSDK_DIR)/lib/x86" }

	DefineRenderer( "Direct2D",
                    { "../Renderers/Direct2D/Direct2D.cpp" } )
	includedirs { "$(DXSDK_DIR)/Include" }
	libdirs { "$(DXSDK_DIR)/lib/x86" }

	DefineRenderer( "GDI",
                    { "../Renderers/GDIPlus/GDIPlus.cpp",
                      "../Renderers/GDIPlus/GDIPlusBuffered.cpp" } )
end

--
-- Samples
--

DefineSample( "CrossPlatform",
              { "../Samples/CrossPlatform/CrossPlatform.cpp" },
              CROSS_LIBS,
              nil,
              { "USE_DEBUG_FONT" } )

DefineSample( "SFML",
              { "../Samples/SFML/SFML.cpp" },
              SFML_LIBS, SFML_LIBS_D, SFML_DEFINES )

DefineSample( "SFML2",
              { "../Samples/SFML2/SFML2.cpp" },
              SFML2_LIBS, SFML2_LIBS_D, SFML2_DEFINES )

DefineSample( "Allegro",
              { "../Samples/Allegro/AllegroSample.cpp" },
              ALLEGRO_LIBS, ALLEGRO_LIBS_D )

if ( os.get() == "windows" ) then

	DefineSample( "Direct2D",
                  { "../Samples/Direct2D/Direct2DSample.cpp" },
                  { "UnitTest", "Renderer-Direct2D", "GWEN-Static", "d2d1",
                    "dwrite", "windowscodecs" } )
	includedirs { "$(DXSDK_DIR)/Include" }
	libdirs { "$(DXSDK_DIR)/lib/x86" }

	DefineSample( "DirectX9",
                  { "../Samples/Direct3D/Direct3DSample.cpp" },
                  { "UnitTest", "Renderer-DirectX9", "GWEN-Static" } )
	includedirs { "$(DXSDK_DIR)/Include" }
	libdirs { "$(DXSDK_DIR)/lib/x86" }

	DefineSample( "WindowsGDI",
                  { "../Samples/WindowsGDI/WindowsGDI.cpp" },
                  { "UnitTest", "Renderer-GDI", "GWEN-Static" } )

	DefineSample( "OpenGL",
                  { "../Samples/OpenGL/OpenGLSample.cpp" },
                  { "UnitTest", "Renderer-OpenGL", "GWEN-Static", "FreeImage", "opengl32" } )

	DefineSample( "OpenGL_DebugFont",
                  { "../Samples/OpenGL/OpenGLSample.cpp" },
                  { "UnitTest", "Renderer-OpenGL_DebugFont", "GWEN-Static", "FreeImage", "opengl32" },
                  nil,
                  { "USE_DEBUG_FONT" } )

end

project "ControlFactory"
	files { "../Util/ControlFactory/**.*" }
	kind "StaticLib"
	targetname( "controlfactory" )

project "ImportExport"
	files { "../Util/ImportExport/**.*" }
	kind "StaticLib"
	targetname( "importexport" )
