solution "game"
	configurations {
		"Debug",
		"Release"
	}
	
	platforms {
        "x32",
        "x64",
	}
	
	language "C++"
	location "build"
	targetdir "bin"
	characterset "MBCS"
	rtti "Off"
	
	filter "x64"
		targetdir "bin_x64"
	
	filter "windows"
		defines { "_WIN32", "WIN32", "WINDOWS" }
	
	filter "Debug"
		defines { "DEBUG", "_DEBUG" }
		targetsuffix "_d"
		flags { "Symbols" }

	filter "Release"
		defines { "NDEBUG" }
		flags { "Symbols", "OptimizeSpeed", "No64BitChecks" }
		
	--filter {}
	
	
PROJ_DIR = path.getabsolute(".")
LIB_DIR = path.getabsolute("thirdparty")
STB_DIR = path.join(LIB_DIR, "stb")
MINIAUDIO_DIR = path.join(LIB_DIR, "miniaudio")
GLAD_DIR = path.join(LIB_DIR, "glad")
GLM_DIR = path.join(LIB_DIR, "glm")
MINILUA_DIR = path.join(LIB_DIR, "minilua")
ODE_DIR = path.join(LIB_DIR, "ode-0.16.5")

-- Open Dynamics Engine
project "ode"
	kind "StaticLib"

	defines { "dIDEDOUBLE", "CCD_IDEDOUBLE", "_OU_FEATURE_SET=_OU_FEATURE_SET_TLS" }

	filter { "Release*" }
		defines { "NDEBUG", "dNODEBUG" }
		flags   { "OptimizeSpeed", "NoFramePointer" }

	-- disable Visual Studio security warnings
	filter { "vs*" }
		defines { "_CRT_SECURE_NO_DEPRECATE", "_SCL_SECURE_NO_WARNINGS" }

	-- enable M_* macros from math.h
	filter { "vs*" }
		defines { "_USE_MATH_DEFINES" }
	
	filter {}

	includedirs {
		path.join(ODE_DIR, "OPCODE"),
		path.join(ODE_DIR, "include"),
		path.join(ODE_DIR, "build"),
		path.join(ODE_DIR, "ou/include"),
		path.join(ODE_DIR, "ou/src"),
		path.join(ODE_DIR, "ode/src"),
		path.join(ODE_DIR, "ode/src/joints"),
	}

	files {
		-- ode sources
		path.join(ODE_DIR, "include/ode/*.h"),
		path.join(ODE_DIR, "ode/src/joints/*.h"), 
		path.join(ODE_DIR, "ode/src/joints/*.cpp"),
		path.join(ODE_DIR, "ode/src/*.h"), 
		path.join(ODE_DIR, "ode/src/*.c"), 
		path.join(ODE_DIR, "ode/src/*.cpp"),	

		-- ou library
		path.join(ODE_DIR, "ou/include/**.h"), 
		path.join(ODE_DIR, "ou/src/**.h"),
		path.join(ODE_DIR, "ou/src/**.cpp"),

		-- OPCODE
		path.join(ODE_DIR, "OPCODE/*.h"), 
		path.join(ODE_DIR, "OPCODE/*.cpp"),
		path.join(ODE_DIR, "OPCODE/Ice/*.h"), 
		path.join(ODE_DIR, "OPCODE/Ice/*.cpp")
	}

	excludes {
		path.join(ODE_DIR, "ode/src/collision_std.cpp"),
		path.join(ODE_DIR, "ode/src/collision_libccd.cpp"), 
		path.join(ODE_DIR, "ode/src/collision_libccd.h")

	}

-- Game
project "game"
	kind "ConsoleApp"
	
	includedirs {
		path.join(PROJ_DIR, "src"),
		path.join(PROJ_DIR, "src/engine"),
		LIB_DIR,
		STB_DIR,
		MINIAUDIO_DIR,
		GLM_DIR,
		MINILUA_DIR,
		path.join(ODE_DIR, "include"),
		path.join(ODE_DIR, "build"),
		path.join(GLAD_DIR, "include")
	}
	
	files {
		-- GLAD
		path.join(GLAD_DIR, "src/*.c"),
		
		-----------------------------------------
		-- Engine

		path.join(PROJ_DIR, "src/engine/utils/*.cpp"),
		path.join(PROJ_DIR, "src/engine/utils/*.h"),
		
		path.join(PROJ_DIR, "src/engine/filesystem/*.cpp"),
		path.join(PROJ_DIR, "src/engine/filesystem/*.h"),
		
		path.join(PROJ_DIR, "src/engine/input/*.cpp"),
		path.join(PROJ_DIR, "src/engine/input/*.h"),
		
		path.join(PROJ_DIR, "src/engine/render/*.cpp"),
		path.join(PROJ_DIR, "src/engine/render/*.h"),
				
		path.join(PROJ_DIR, "src/engine/sound/*.cpp"),
		path.join(PROJ_DIR, "src/engine/sound/*.h"),
		
		path.join(PROJ_DIR, "src/engine/physics/*.cpp"),
		path.join(PROJ_DIR, "src/engine/physics/*.h"),
		
		-----------------------------------------
		-- Game	
		
		path.join(PROJ_DIR, "src/game/*.c"),
		path.join(PROJ_DIR, "src/game/*.cpp"),
		path.join(PROJ_DIR, "src/game/*.h"),
		
		-----------------------------------------
		-- Main
		path.join(PROJ_DIR, "src/main/*.cpp"),
		path.join(PROJ_DIR, "src/main/*.h"),
	}
	
	links { "ode" }
