bam: Move library build to engine.build.lua file.
This commit is contained in:
parent
a19944437b
commit
66f3bb30d9
2 changed files with 153 additions and 143 deletions
148
bam.lua
148
bam.lua
|
|
@ -70,150 +70,12 @@ end
|
|||
|
||||
--------------------------------
|
||||
-- --
|
||||
-- Engine configuration --
|
||||
-- Build Targets --
|
||||
-- --
|
||||
--------------------------------
|
||||
|
||||
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",
|
||||
"MessageHandler.cpp",
|
||||
"MessageQueue.cpp",
|
||||
"SystemEvent.cpp",
|
||||
"Log.cpp"
|
||||
})
|
||||
|
||||
local platform_common_module = Module("source/Platform", {
|
||||
"PlatformDisplay.cpp"
|
||||
})
|
||||
|
||||
|
||||
-- if TARGET_OS == "Win32" then -- Needed later for unix.
|
||||
platform_spec_module = Module("source/Platform/Win32", {
|
||||
"Win32Application.cpp",
|
||||
"Win32Display.cpp",
|
||||
"Win32GLContext.cpp",
|
||||
"Win32Input.cpp",
|
||||
"Win32Internal.cpp",
|
||||
"Win32Keyboard.cpp",
|
||||
"Win32Misc.cpp",
|
||||
"Win32Mouse.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
|
||||
)
|
||||
|
||||
DefaultTarget(libspectre)
|
||||
|
||||
-- Examples
|
||||
Import("engine.build.lua")
|
||||
Import("examples/build.lua")
|
||||
|
||||
-- Set engine library as default target
|
||||
DefaultTarget(libspectre)
|
||||
|
|
|
|||
148
engine.build.lua
Normal file
148
engine.build.lua
Normal file
|
|
@ -0,0 +1,148 @@
|
|||
-----------------------------------------------------------
|
||||
-- --
|
||||
-- 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",
|
||||
"MessageHandler.cpp",
|
||||
"MessageQueue.cpp",
|
||||
"SystemEvent.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",
|
||||
"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
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue