Merge branch 'master' into vulkan

This commit is contained in:
Lynix
2017-11-24 20:14:39 +01:00
559 changed files with 10925 additions and 3359 deletions

1
build/Build_VS2017.bat Normal file
View File

@@ -0,0 +1 @@
premake5 vs2017

View File

@@ -16,8 +16,8 @@ Configurations = "Debug,Release" -- "Debug,Release,ReleaseWithDebug"
-- Setup additionnals install directories, separated by a semi-colon ; (library binaries will be copied there)
--InstallDir = "/usr/local/lib64"
-- Adds a project which will recall premake with its original arguments when built
PremakeProject = true
-- Adds a project which will recall premake with its original arguments when built (only works on Windows for now)
PremakeProject = false
-- Excludes client-only modules/tools/examples
ServerMode = false

View File

@@ -5,8 +5,14 @@ ACTION.Function = function ()
print("Encoding resources ...")
local startClock = os.clock()
local modules = os.matchdirs("../src/Nazara/*")
table.insert(modules, "../SDK/src/NDK")
for k, modulePath in pairs(modules) do
local moduleName = modulePath:sub(15, -1)
local moduleName
if (modulePath:sub(4, 6) == "src") then
moduleName = modulePath:sub(15, -1)
else
moduleName = "SDK"
end
local files = os.matchfiles(modulePath .. "/Resources/**")
for k, filePath in pairs(files) do
if (filePath:sub(-2) ~= ".h") then

View File

@@ -84,13 +84,13 @@ ACTION.Function = function ()
local libFileMasks
local exeFileExt
local exeFilterFunc
if (os.is("windows")) then
if (os.ishost("windows")) then
binFileMasks = {"**.dll", "**.pdb"}
libFileMasks = {"**.lib", "**.a"}
exeFileExt = ".exe"
exeFilterFunc = function (filePath) return true end
else
if (os.is("macosx")) then
if (os.ishost("macosx")) then
binFileMasks = {"**.dynlib"}
else
binFileMasks = {"**.so"}
@@ -183,14 +183,7 @@ ACTION.Function = function ()
end
end
local ok, err
if (os.is("windows")) then
ok, err = os.copyfile(v, targetPath)
else
-- Workaround: As premake is translating this to "cp %s %s", it fails if space are presents in source/destination paths.
ok, err = os.copyfile(string.format("\"%s\"", v), string.format("\"%s\"", targetPath))
end
local ok, err = os.copyfile(v, targetPath)
if (not ok) then
print("Failed to copy \"" .. v .. "\" to \"" .. targetPath .. "\": " .. err)
end
@@ -203,5 +196,5 @@ ACTION.Function = function ()
end
local config = libDir .. " - " .. enabledArchs
print(string.format("Package successfully created at \"%s\" (%u MB, %s)", packageDir, size / (1024 * 1024), config))
print(string.format("Package successfully created at \"%s\" (%u MB, %s)", packageDir, size // (1024 * 1024), config))
end

View File

@@ -128,7 +128,7 @@ function NazaraBuild:Execute()
language("C++")
location(_ACTION)
if (self.Config["PremakeProject"]) then
if (self.Config["PremakeProject"] and os.ishost("windows")) then
local commandLine = "premake5.exe " .. table.concat(_ARGV, ' ')
project("_PremakeProject")
kind("Utility")
@@ -477,10 +477,8 @@ function NazaraBuild:LoadConfig()
local content = f:read("*a")
f:close()
local func, err = loadstring(content)
local func, err = load(content, "Config file", "t", self.Config)
if (func) then
setfenv(func, self.Config)
local status, err = pcall(func)
if (not status) then
print("Failed to load config.lua: " .. err)
@@ -607,7 +605,7 @@ function NazaraBuild:LoadConfig()
end
function NazaraBuild:MakeInstallCommands(infoTable)
if (os.is("windows")) then
if (os.istarget("windows")) then
filter("kind:SharedLib")
postbuildmessage("Copying " .. infoTable.Name .. " library and its dependencies to install/executable directories...")
@@ -739,13 +737,13 @@ function NazaraBuild:Process(infoTable)
for platform, defineTable in pairs(v) do
platform = string.lower(platform)
if (platform == "posix") then
local osname = os.get()
local osname = os.target()
if (PosixOSes[osname]) then
platform = osname
end
end
if (os.is(platform)) then
if (os.istarget(platform)) then
for k,v in ipairs(defineTable) do
table.insert(targetTable, v)
end
@@ -779,13 +777,14 @@ end
function NazaraBuild:PrepareGeneric()
flags({
"C++14",
"MultiProcessorCompile",
"NoMinimalRebuild",
"RelativeLinks",
"ShadowedVariables",
"UndefinedIdentifiers"
})
cppdialect("C++14")
self:FilterLibDirectory("../extlibs/lib/", libdirs)

View File

@@ -3,5 +3,6 @@ MODULE.Name = "Graphics"
MODULE.Libraries = {
"NazaraCore",
"NazaraUtility",
"NazaraPlatform",
"NazaraRenderer"
}

View File

@@ -0,0 +1,31 @@
MODULE.Name = "Platform"
MODULE.Libraries = {
"NazaraCore",
"NazaraUtility"
}
MODULE.OsFiles.Windows = {
"../src/Nazara/Platform/Win32/**.hpp",
"../src/Nazara/Platform/Win32/**.cpp"
}
MODULE.OsFiles.Posix = {
"../src/Nazara/Platform/X11/**.hpp",
"../src/Nazara/Platform/X11/**.cpp"
}
MODULE.OsLibraries.Windows = {
"gdi32"
}
MODULE.OsLibraries.Posix = {
"X11",
"xcb",
"xcb-cursor",
"xcb-ewmh",
"xcb-icccm",
"xcb-keysyms",
"xcb-randr"
}

View File

@@ -8,7 +8,8 @@ MODULE.Defines = {
MODULE.Libraries = {
"NazaraCore",
"NazaraUtility"
"NazaraUtility",
"NazaraPlatform"
}
MODULE.OsFiles.Windows = {

View File

@@ -5,29 +5,11 @@ MODULE.Libraries = {
"stb_image"
}
MODULE.OsFiles.Windows = {
"../src/Nazara/Utility/Win32/**.hpp",
"../src/Nazara/Utility/Win32/**.cpp"
}
MODULE.OsFiles.Posix = {
"../src/Nazara/Utility/X11/**.hpp",
"../src/Nazara/Utility/X11/**.cpp"
}
MODULE.OsLibraries.Windows = {
"freetype-s",
"gdi32"
"freetype-s"
}
MODULE.OsLibraries.Posix = {
"freetype",
"X11",
"xcb",
"xcb-cursor",
"xcb-ewmh",
"xcb-icccm",
"xcb-keysyms",
"xcb-randr"
"freetype"
}

View File

@@ -37,7 +37,8 @@ TOOL.FilesExcluded = {
"../SDK/**/*Widget*.*",
"../SDK/**/LuaBinding_Audio.*",
"../SDK/**/LuaBinding_Graphics.*",
"../SDK/**/LuaBinding_Renderer.*"
"../SDK/**/LuaBinding_Renderer.*",
"../SDK/**/LuaBinding_Platform.*"
}

View File

@@ -25,7 +25,7 @@ TOOL.Files = {
TOOL.FilesExcluded = {
"../tests/Engine/Audio/**",
"../tests/Engine/Graphics/**",
"../tests/Engine/Utility/**",
"../tests/Engine/Platform/**",
"../tests/SDK/NDK/Application.cpp",
"../tests/SDK/NDK/Systems/ListenerSystem.cpp",
"../tests/SDK/NDK/Systems/RenderSystem.cpp"