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 = {
|
local _systems = {
|
||||||
"Win32",
|
"Win32",
|
||||||
-- "Linux"
|
"Unix"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -14,12 +14,19 @@ end
|
||||||
-- Detect what system we currently are on.
|
-- Detect what system we currently are on.
|
||||||
function system()
|
function system()
|
||||||
|
|
||||||
local win = os.getenv('OS')
|
if family ~= nil then
|
||||||
|
if family == "windows" then
|
||||||
if win:lower():match('windows') then
|
|
||||||
return _systems[1]
|
return _systems[1]
|
||||||
end
|
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
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1,4 +1,5 @@
|
||||||
|
|
||||||
|
# Build system related files
|
||||||
build/
|
build/
|
||||||
.bam/*
|
.bam/*
|
||||||
!.bam/*.lua
|
!.bam/*.lua
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,15 @@ if global_settings.debug then
|
||||||
end
|
end
|
||||||
|
|
||||||
-- FreeType2
|
-- FreeType2
|
||||||
|
if TARGET_OS == "Win32" then
|
||||||
settings.cc.includes:Add("vendor/FreeType2/include")
|
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
|
-- STB
|
||||||
settings.cc.includes:Add("vendor/stb/include")
|
settings.cc.includes:Add("vendor/stb/include")
|
||||||
|
|
||||||
|
|
@ -41,8 +48,7 @@ local platform_common_module = Module("source/Platform", {
|
||||||
"PlatformDisplay.cpp"
|
"PlatformDisplay.cpp"
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if TARGET_OS == "Win32" then
|
||||||
-- if TARGET_OS == "Win32" then -- Needed later for unix.
|
|
||||||
local platform_spec_module = Module("source/Platform/Win32", {
|
local platform_spec_module = Module("source/Platform/Win32", {
|
||||||
"Win32Application.cpp",
|
"Win32Application.cpp",
|
||||||
"Win32Display.cpp",
|
"Win32Display.cpp",
|
||||||
|
|
@ -56,7 +62,19 @@ local platform_spec_module = Module("source/Platform/Win32", {
|
||||||
"Win32System.cpp",
|
"Win32System.cpp",
|
||||||
"glad_wgl.c"
|
"glad_wgl.c"
|
||||||
})
|
})
|
||||||
--end
|
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", {
|
local input_module = Module("source/Input", {
|
||||||
"InputDevice.cpp",
|
"InputDevice.cpp",
|
||||||
|
|
@ -132,7 +150,9 @@ local scene_module = Module("source/Scene", {
|
||||||
-----------------------------------------------------------
|
-----------------------------------------------------------
|
||||||
|
|
||||||
-- Dependancies
|
-- Dependancies
|
||||||
|
if TARGET_OS == "Win32" then
|
||||||
Import("vendor/FreeType2/build.lua")
|
Import("vendor/FreeType2/build.lua")
|
||||||
|
end
|
||||||
|
|
||||||
-- engine
|
-- engine
|
||||||
local obj = Compile(settings, {
|
local obj = Compile(settings, {
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,10 @@ if TARGET_OS == "Win32" then
|
||||||
|
|
||||||
-- Windows needs to link against these.
|
-- Windows needs to link against these.
|
||||||
example_settings.link.libs:Add("opengl32", "gdi32", "user32")
|
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
|
end
|
||||||
|
|
||||||
-- For now, to get examples working
|
-- For now, to get examples working
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue