150 lines
3 KiB
Lua
150 lines
3 KiB
Lua
-----------------------------------------------------------
|
|
-- --
|
|
-- Engine configuration --
|
|
-- --
|
|
-- Builds Spectre engine as static library. --
|
|
-- --
|
|
-- Output variables: --
|
|
-- libspectre = path to .lib file --
|
|
-----------------------------------------------------------
|
|
|
|
local settings = CopySettings(global_settings, "Engine")
|
|
|
|
settings.cc.includes:Add("include/")
|
|
settings.cc.includes:Add("source/")
|
|
|
|
-- FreeType2
|
|
settings.cc.includes:Add("vendor/FreeType2/include")
|
|
|
|
-- STB
|
|
settings.cc.includes:Add("vendor/stb/include")
|
|
|
|
-- Source files
|
|
-----------------------------------------------------------
|
|
|
|
local system_module = Module("source/System", {
|
|
"File.cpp",
|
|
"Path.cpp",
|
|
"MessageHandler.cpp",
|
|
"MessageQueue.cpp",
|
|
"Event.cpp",
|
|
"Log.cpp"
|
|
})
|
|
|
|
local platform_common_module = Module("source/Platform", {
|
|
"PlatformDisplay.cpp"
|
|
})
|
|
|
|
|
|
-- if TARGET_OS == "Win32" then -- Needed later for unix.
|
|
local platform_spec_module = Module("source/Platform/Win32", {
|
|
"Win32Application.cpp",
|
|
"Win32Display.cpp",
|
|
"Win32GLContext.cpp",
|
|
"Win32Input.cpp",
|
|
"Win32Internal.cpp",
|
|
"Win32Keyboard.cpp",
|
|
"Win32Misc.cpp",
|
|
"Win32Mouse.cpp",
|
|
"Win32EventQueue.cpp",
|
|
"Win32MsgBuffer.cpp",
|
|
"Win32System.cpp",
|
|
"glad_wgl.c"
|
|
})
|
|
--end
|
|
|
|
local input_module = Module("source/Input", {
|
|
"InputDevice.cpp",
|
|
"InputEvent.cpp",
|
|
"InputListener.cpp",
|
|
"InputModule.cpp",
|
|
"Keyboard.cpp",
|
|
"Mouse.cpp"
|
|
})
|
|
|
|
local display_module = Module("source/Display", {
|
|
"Display.cpp",
|
|
"DisplayDescription.cpp",
|
|
"DisplayMode.cpp",
|
|
"GLContext.cpp"
|
|
})
|
|
|
|
local graphics_module = Module("source/Graphics", {
|
|
-- Primitives
|
|
"Vertex2D.cpp",
|
|
"Transformable.cpp",
|
|
"Sprite.cpp",
|
|
|
|
-- Rendering
|
|
"BatchRenderer2D.cpp",
|
|
"DefaultRenderer2D.cpp",
|
|
"Renderable2D.cpp",
|
|
"Renderer2D.cpp",
|
|
"RenderState.cpp",
|
|
"Shader.cpp",
|
|
"ShaderProgram.cpp",
|
|
"Texture.cpp",
|
|
|
|
-- Text
|
|
"Font/Engine/FreeTypeEngine.cpp",
|
|
"Font/Engine/FreeTypeError.cpp",
|
|
"Font/Engine/FreeTypeLib.cpp",
|
|
"Font/FontDescription.cpp",
|
|
"Font.cpp",
|
|
"Text.cpp",
|
|
|
|
-- Image
|
|
"Image.cpp",
|
|
"ImageLoader.cpp",
|
|
|
|
"OpenGL.cpp",
|
|
"GL/glad.c",
|
|
"GL/CheckError.cpp",
|
|
})
|
|
|
|
local core_module = Module("source/Core", {
|
|
"String.cpp"
|
|
})
|
|
|
|
local math_module = Module("source/Math", {
|
|
"Color.cpp",
|
|
"Logarithm.cpp",
|
|
"Math.cpp",
|
|
"Transform.cpp"
|
|
})
|
|
|
|
local game_module = Module("source", {
|
|
"Game/FPSCounter.cpp",
|
|
"Game/GameTime.cpp",
|
|
"Game.cpp",
|
|
})
|
|
|
|
local scene_module = Module("source/Scene", {
|
|
"Camera2D.cpp"
|
|
})
|
|
|
|
-- Build target
|
|
-----------------------------------------------------------
|
|
|
|
-- Dependancies
|
|
Import("vendor/FreeType2/build.lua")
|
|
|
|
-- engine
|
|
local obj = Compile(settings, {
|
|
system_module,
|
|
platform_common_module,
|
|
platform_spec_module,
|
|
input_module,
|
|
display_module,
|
|
graphics_module,
|
|
core_module,
|
|
math_module,
|
|
game_module,
|
|
scene_module
|
|
})
|
|
|
|
libspectre = StaticLibrary(settings,
|
|
"spectre",
|
|
obj,
|
|
ft2_obj
|
|
)
|