-------------------------------------------------------------------------------
--
-------------------------------------------------------------------------------	

include "../../premake/common/"

-------------------------------------------------------------------------------
--
-------------------------------------------------------------------------------

solution "GLWebtools"

	addCommonConfig()
	
	if IsWin32() then
		configurations { "Debug_CU", "Release_CU"}
	end
	
-------------------------------------------------------------------------------
--
-------------------------------------------------------------------------------

project "GLWebtools"

	-- common settings
	kind "StaticLib"
	
	uuid "BB42F2D0-09A7-4D75-B076-60848E335280"
	
	targetname "GLWebtools"
	targetdir ("../lib/" .. GetPathFromPlatform())
	objdir ("../obj/" .. GetPathFromPlatform())
	
	includedirs
	{		
		"../include",
		"../source",
		"../../GLWebtools_config",
		"../../glf/include",
		"../../curl/include",
		"../../openssl/include",
		"../../openssl"
	}
	
	if IsWin32() then
		filter {"Release"}
			files
			{
				"../source/**.h",
				"../include/**.h",
				"../source/**.cpp",
				"../source/glwebtools/jsoncpp/*.inl"
			}		
			excludes
			{
				"../source/**_cu.cpp"
			}
		filter{}
		
		filter {"Debug"}
			files
			{
				"../source/**.h",
				"../include/**.h",
				"../source/**.cpp",
				"../source/glwebtools/jsoncpp/*.inl"
			}		
			excludes
			{
				"../source/**_cu.cpp"
			}
		filter{}
	
		filter {"*_CU"}
			files
			{
				"../source/**_cu.cpp"
			}
		filter{}
	else
		files
		{
			"../source/**_cu.cpp"
		}
	end
	
	if IsVisualStudio() then
	
		defines
		{
			"WIN32_LEAN_AND_MEAN"
		}
		
		--ImportProps("../../GLWebtools_config/" .. _OPTIONS["to"] .. "/GLWebtools")
		--GenerateProps(_OPTIONS["to"].."/props/user/GLWebtools")
		GenerateVsProps(_OPTIONS["to"].."/props/user/common.props")
	
		configurationfiles ( {"../../GLWebtools_config/" .. _OPTIONS["to"] .. "/common.props"})
	end
	
	if IsAndroidS2G() then
		
		AddAndroidS2GDefaultConfig()
		
		include "../../premake/android_s2g/android_s2g.lua"
		
	elseif IsXCode() then
	
		generatexcconfigs "YES"
	
		configurationfiles
		{
			"../../GLWebtools_config/" .. _OPTIONS["to"] .. "/user-debug-project.xcconfig",
			"../../GLWebtools_config/" .. _OPTIONS["to"] .. "/user-release-project.xcconfig",
			"../../GLWebtools_config/" .. _OPTIONS["to"] .. "/user-debug-target.xcconfig",
			"../../GLWebtools_config/" .. _OPTIONS["to"] .. "/user-release-target.xcconfig"
		}
		
		configuration "../source/**_cu.cpp"
			language "ObjCpp"
		configuration {}
		
		links
		{			
            "Foundation.framework"
		}
		
		linkoptions
		{
			"-framework Foundation"
		}
		
		files
		{
			"../include/**.pch"
		}
		
		defines
		{
			"GLWEBTOOLS_GLWEBTOOLS_STANDALONE"
		}
		
		addCommonXcodeBuildSettings()
		
		xcodebuildsettings
		{
			["ARCHS"] = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
			['GCC_PRECOMPILE_PREFIX_HEADER'] = 'YES';
			['GCC_PREFIX_HEADER'] = "../../../include/glwebtools/pch/glwebtools-Prefix.pch";
		}
	end