bam: adding unix support.
This commit is contained in:
parent
6464838159
commit
1cfd4adca4
4 changed files with 55 additions and 23 deletions
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
local _systems = {
|
||||
"Win32",
|
||||
-- "Linux"
|
||||
"Unix"
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -14,12 +14,19 @@ end
|
|||
-- Detect what system we currently are on.
|
||||
function system()
|
||||
|
||||
local win = os.getenv('OS')
|
||||
|
||||
if win:lower():match('windows') then
|
||||
return _systems[1]
|
||||
if family ~= nil then
|
||||
if family == "windows" then
|
||||
return _systems[1]
|
||||
end
|
||||
if family == "unix" then
|
||||
return _systems[2]
|
||||
end
|
||||
end
|
||||
|
||||
local win = os.getenv('OS')
|
||||
if win ~= nil and win:lower():match('windows') then
|
||||
return _systems[1]
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
|
|
|
|||
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1,4 +1,5 @@
|
|||
|
||||
# Build system related files
|
||||
build/
|
||||
.bam/*
|
||||
!.bam/*.lua
|
||||
|
|
|
|||
|
|
@ -18,7 +18,14 @@ if global_settings.debug then
|
|||
end
|
||||
|
||||
-- FreeType2
|
||||
settings.cc.includes:Add("vendor/FreeType2/include")
|
||||
if TARGET_OS == "Win32" then
|
||||
settings.cc.includes:Add("vendor/FreeType2/include")
|
||||
|
||||
-- Staticly link freetype on windows.
|
||||
settings.link.libpath:Add("vendor/FreeType2/lib/x86")
|
||||
else
|
||||
settings.cc.includes:Add("/usr/include/freetype2")
|
||||
end
|
||||
|
||||
-- STB
|
||||
settings.cc.includes:Add("vendor/stb/include")
|
||||
|
|
@ -41,22 +48,33 @@ 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",
|
||||
"Win32System.cpp",
|
||||
"glad_wgl.c"
|
||||
})
|
||||
--end
|
||||
if TARGET_OS == "Win32" then
|
||||
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",
|
||||
"Win32System.cpp",
|
||||
"glad_wgl.c"
|
||||
})
|
||||
elseif TARGET_OS == "Unix" then
|
||||
platform_spec_module = Module("source/Platform/Unix", {
|
||||
"UnixApplication.cpp",
|
||||
"X11Display.cpp",
|
||||
"GLXContext.cpp",
|
||||
"X11Input.cpp",
|
||||
"X11Keyboard.cpp",
|
||||
"X11Mouse.cpp",
|
||||
"X11EventQueue.cpp",
|
||||
"UnixMisc.cpp",
|
||||
"UnixSystem.cpp"
|
||||
})
|
||||
end
|
||||
|
||||
local input_module = Module("source/Input", {
|
||||
"InputDevice.cpp",
|
||||
|
|
@ -132,7 +150,9 @@ local scene_module = Module("source/Scene", {
|
|||
-----------------------------------------------------------
|
||||
|
||||
-- Dependancies
|
||||
Import("vendor/FreeType2/build.lua")
|
||||
if TARGET_OS == "Win32" then
|
||||
Import("vendor/FreeType2/build.lua")
|
||||
end
|
||||
|
||||
-- engine
|
||||
local obj = Compile(settings, {
|
||||
|
|
|
|||
|
|
@ -16,6 +16,10 @@ if TARGET_OS == "Win32" then
|
|||
|
||||
-- Windows needs to link against these.
|
||||
example_settings.link.libs:Add("opengl32", "gdi32", "user32")
|
||||
elseif TARGET_OS == "Unix" then
|
||||
|
||||
-- Unix nees dl and X11 libs.
|
||||
example_settings.link.libs:Add("dl", 'X11', 'freetype')
|
||||
end
|
||||
|
||||
-- For now, to get examples working
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue