Move all build files to build directory

Former-commit-id: 499125a81d877144aabe7d89bb69043b92872b24
This commit is contained in:
Lynix 2015-06-14 01:47:02 +02:00
parent aee0812505
commit a6092be930
3 changed files with 197 additions and 216 deletions

49
.gitignore vendored
View File

@ -11,42 +11,43 @@ SDK/lib/NazaraSDK*.so
build/scripts/features/index.html
# Codeblocks
*.cbp
*.cbTemp
*.cscope_file_list
*.depend
*.layout
*.workspace
build/**/*.cbp
build/**/*.cbp
build/**/*.cbTemp
build/**/*.cscope_file_list
build/**/*.depend
build/**/*.layout
build/**/*.workspace
# CodeLite
*.project
build/**/*.project
# Visual Studio
*.filters
*.vcxproj
*.tlog
*.sln
*.vcxprojResolveAssemblyReference.cache
*.exp
*.nativecodeanalysis.all.xml
*.nativecodeanalysis.xml
build/**/*.filters
build/**/*.vcxproj
build/**/*.tlog
build/**/*.sln
build/**/*.vcxprojResolveAssemblyReference.cache
build/**/*.nativecodeanalysis.all.xml
build/**/*.nativecodeanalysis.xml
lib/*.exp
# Compiled Object files
*.slo
*.lo
*.o
*.obj
build/**/*.slo
build/**/*.lo
build/**/*.o
build/**/*.obj
# Compiled Dynamic libraries
*.so
*.lib
build/**/*.so
lib/*.lib
# Compiled Static libraries
*.lai
*.la
build/**/*.lai
build/**/*.la
# Object files
*.o
build/**/*.o
# Windows image file caches
Thumbs.db

View File

@ -231,9 +231,7 @@ function Feature.GenerateFeatureList(featureTable, space, content)
table.insert(content, string.format("%s</ul>", space))
end
newaction
{
trigger = "generatefeatures",
description = "Generate a web page describing each module's feature",
execute = Feature.Generate
}
ACTION.Name = "GenerateFeatures"
ACTION.Description = "Generate a web page describing each module's feature"
ACTION.Function = Feature.Generate

View File

@ -1,231 +1,60 @@
local PosixOSes = {"bsd", "linux", "macosx", "solaris"}
NazaraBuild = {} -- L'équivalent d'un namespace en Lua est une table
NazaraBuild = {} -- L'équivalent d'un namespace en Lua est une table
function NazaraBuild:Execute()
if (_ACTION == nil) then -- Si aucune action n'est spécifiée
if (_ACTION == nil) then -- Si aucune action n'est spécifiée
return -- Alors l'utilisateur voulait probablement savoir comment utiliser le programme, on ne fait rien
end
if (self.Actions[_ACTION] ~= nil) then
self.Actions[_ACTION].Function()
else
solution "NazaraEngine"
-- Configuration générale
configurations
{
-- "DebugStatic",
-- "ReleaseStatic",
"DebugDynamic",
"ReleaseDynamic"
}
defines "NAZARA_BUILD"
language "C++"
location(_ACTION)
includedirs
{
"../include",
"../src/",
"../extlibs/include"
}
libdirs "../lib"
if (_OPTIONS["x64"]) then
defines "NAZARA_PLATFORM_x64"
libdirs "../extlibs/lib/x64"
else
libdirs "../extlibs/lib/x86"
end
targetdir "../lib"
configuration "Debug*"
defines "NAZARA_DEBUG"
flags "Symbols"
configuration "Release*"
flags { "EnableSSE2", "Optimize", "OptimizeSpeed", "NoFramePointer", "NoRTTI" }
configuration { "Release*", "codeblocks or codelite or gmake or xcode3 or xcode4" }
buildoptions "-mfpmath=sse" -- Utilisation du SSE pour les calculs flottants
buildoptions "-ftree-vectorize" -- Activation de la vectorisation du code
configuration "*Static"
defines "NAZARA_STATIC"
kind "StaticLib"
configuration "*Dynamic"
kind "SharedLib"
configuration "DebugStatic"
targetsuffix "-s-d"
configuration "ReleaseStatic"
targetsuffix "-s"
configuration "DebugDynamic"
targetsuffix "-d"
configuration "codeblocks or codelite or gmake or xcode3 or xcode4"
buildoptions "-std=c++11"
if (_OPTIONS["x64"]) then
buildoptions "-m64"
end
configuration { "linux or bsd or macosx", "gmake" }
buildoptions "-fvisibility=hidden"
configuration { "linux or bsd or macosx", "gmake" }
buildoptions "-fvisibility=hidden"
configuration "vs*"
defines "_CRT_SECURE_NO_WARNINGS"
defines "_SCL_SECURE_NO_WARNINGS"
-- Spécification des modules
if (_OPTIONS["united"]) then
project "NazaraEngine"
end
for i=1, #self.Modules do
local moduleTable = self.Modules[i]
if (not _OPTIONS["united"]) then
project("Nazara" .. moduleTable.Name)
end
configuration {}
files(moduleTable.Files)
excludes(moduleTable.FilesExclusion)
defines(moduleTable.Defines)
flags(moduleTable.Flags)
links(moduleTable.Libraries)
for k,v in pairs(moduleTable.ConfigurationLibraries) do
configuration(k)
links(v)
end
end
end
if (_OPTIONS["with-examples"]) then
solution "NazaraExamples"
-- Configuration générale
configurations
{
-- "DebugStatic",
-- "ReleaseStatic",
"DebugDynamic",
"ReleaseDynamic"
}
language "C++"
location("../examples/build/" .. _ACTION)
debugdir "../examples/bin"
includedirs "../include"
libdirs "../lib"
if (_OPTIONS["x64"]) then
defines "NAZARA_PLATFORM_x64"
libdirs "../extlibs/lib/x64"
else
libdirs "../extlibs/lib/x86"
end
targetdir "../examples/bin"
configuration "Debug*"
defines "NAZARA_DEBUG"
flags "Symbols"
configuration "Release*"
flags { "EnableSSE2", "Optimize", "OptimizeSpeed", "NoFramePointer", "NoRTTI" }
configuration { "Release*", "codeblocks or codelite or gmake or xcode3 or xcode4" }
buildoptions "-mfpmath=sse" -- Utilisation du SSE pour les calculs flottants
buildoptions "-ftree-vectorize" -- Activation de la vectorisation du code
configuration "*Static"
defines "NAZARA_STATIC"
configuration "codeblocks or codelite or gmake or xcode3 or xcode4"
buildoptions "-std=c++11"
for i=1, #self.Examples do
local exampleTable = self.Examples[i]
project("Demo" .. exampleTable.Name)
if (exampleTable.Console) then
kind "ConsoleApp"
else
kind "Window"
end
files(exampleTable.Files)
excludes(exampleTable.FilesExclusion)
defines(exampleTable.Defines)
flags(exampleTable.Flags)
links(exampleTable.Libraries)
for k,v in pairs(exampleTable.ConfigurationLibraries) do
configuration(k)
links(v)
end
end
end
if (_OPTIONS["with-extlibs"]) then
solution "NazaraExtlibs"
-- Configuration générale
configurations
{
solution("NazaraExtlibs")
-- Configuration générale
configurations({
"DebugStatic",
"ReleaseStatic"
}
})
location("../extlibs/build/" .. _ACTION)
includedirs "../extlibs/include"
kind "StaticLib"
includedirs("../extlibs/include")
location(_ACTION)
kind("StaticLib")
if (_OPTIONS["x64"]) then
libdirs "../extlibs/lib/x64"
targetdir "../extlibs/lib/x64"
libdirs("../extlibs/lib/x64")
targetdir("../extlibs/lib/x64")
else
libdirs "../extlibs/lib/x86"
targetdir "../extlibs/lib/x86"
libdirs("../extlibs/lib/x86")
targetdir("../extlibs/lib/x86")
end
configuration "Debug*"
flags "Symbols"
configuration("Debug*")
flags("Symbols")
configuration "Release*"
flags { "EnableSSE2", "Optimize", "OptimizeSpeed", "NoFramePointer", "NoRTTI" }
configuration("Release*")
flags({"EnableSSE2", "Optimize", "OptimizeSpeed", "NoFramePointer", "NoRTTI"})
configuration { "Release*", "codeblocks or codelite or gmake or xcode3 or xcode4" }
buildoptions "-mfpmath=sse" -- Utilisation du SSE pour les calculs flottants
buildoptions "-ftree-vectorize" -- Activation de la vectorisation du code
configuration({"Release*", "codeblocks or codelite or gmake or xcode3 or xcode4"})
buildoptions("-mfpmath=sse") -- Utilisation du SSE pour les calculs flottants
buildoptions("-ftree-vectorize") -- Activation de la vectorisation du code
configuration "DebugStatic"
targetsuffix "-s-d"
configuration("DebugStatic")
targetsuffix("-s-d")
configuration "ReleaseStatic"
targetsuffix "-s"
configuration("ReleaseStatic")
targetsuffix("-s")
configuration "codeblocks or codelite or gmake or xcode3 or xcode4"
buildoptions "-std=c++11"
configuration("codeblocks or codelite or gmake or xcode3 or xcode4")
buildoptions("-std=c++11")
for i=1, #self.ExtLibs do
local libTable = self.ExtLibs[i]
project(libTable.Name)
language(libTable.Language)
location(_ACTION .. "/extlibs")
files(libTable.Files)
excludes(libTable.FilesExclusion)
@ -238,33 +67,185 @@ function NazaraBuild:Execute()
configuration(k)
links(v)
end
configuration({})
end
end
solution("NazaraEngine")
-- Configuration générale
configurations({
-- "DebugStatic",
-- "ReleaseStatic",
"DebugDynamic",
"ReleaseDynamic"
})
language("C++")
location(_ACTION)
configuration("Debug*")
defines("NAZARA_DEBUG")
flags("Symbols")
configuration("Release*")
flags({"EnableSSE2", "Optimize", "OptimizeSpeed", "NoFramePointer", "NoRTTI"})
configuration({"Release*", "codeblocks or codelite or gmake or xcode3 or xcode4"})
buildoptions("-mfpmath=sse") -- Utilisation du SSE pour les calculs flottants
buildoptions("-ftree-vectorize") -- Activation de la vectorisation du code
configuration("*Static")
defines("NAZARA_STATIC")
configuration("codeblocks or codelite or gmake or xcode3 or xcode4")
buildoptions("-std=c++11")
if (_OPTIONS["x64"]) then
buildoptions("-m64")
end
configuration({"linux or bsd or macosx", "gmake"})
buildoptions("-fvisibility=hidden")
configuration({"linux or bsd or macosx", "gmake"})
buildoptions("-fvisibility=hidden")
configuration("vs*")
defines("_CRT_SECURE_NO_WARNINGS")
defines("_SCL_SECURE_NO_WARNINGS")
-- Spécification des modules
if (_OPTIONS["united"]) then
project("NazaraEngine")
end
for i=1, #self.Modules do
local moduleTable = self.Modules[i]
if (not _OPTIONS["united"]) then
project("Nazara" .. moduleTable.Name)
end
location(_ACTION .. "/modules")
defines("NAZARA_BUILD")
includedirs({
"../include",
"../src/",
"../extlibs/include"
})
libdirs("../lib")
if (_OPTIONS["x64"]) then
defines("NAZARA_PLATFORM_x64")
libdirs("../extlibs/lib/x64")
else
libdirs("../extlibs/lib/x86")
end
targetdir("../lib")
configuration("*Static")
kind("StaticLib")
configuration("*Dynamic")
kind("SharedLib")
configuration("DebugStatic")
targetsuffix("-s-d")
configuration("ReleaseStatic")
targetsuffix("-s")
configuration("DebugDynamic")
targetsuffix("-d")
configuration({})
files(moduleTable.Files)
excludes(moduleTable.FilesExclusion)
defines(moduleTable.Defines)
flags(moduleTable.Flags)
links(moduleTable.Libraries)
for k,v in pairs(moduleTable.ConfigurationLibraries) do
configuration(k)
links(v)
end
configuration({})
end
end
if (_OPTIONS["with-examples"]) then
for i=1, #self.Examples do
local exampleTable = self.Examples[i]
project("Demo" .. exampleTable.Name)
location(_ACTION .. "/examples")
if (exampleTable.Console) then
kind("ConsoleApp")
else
kind("Window")
end
debugdir("../examples/bin")
includedirs("../include")
libdirs("../lib")
if (_OPTIONS["x64"]) then
defines("NAZARA_PLATFORM_x64")
libdirs("../extlibs/lib/x64")
else
libdirs("../extlibs/lib/x86")
end
targetdir("../examples/bin")
files(exampleTable.Files)
excludes(exampleTable.FilesExclusion)
defines(exampleTable.Defines)
flags(exampleTable.Flags)
links(exampleTable.Libraries)
for k,v in pairs(exampleTable.ConfigurationLibraries) do
configuration(k)
links(v)
end
configuration({})
end
end
end
function NazaraBuild:Initialize()
-- Commençons par les options
newoption {
-- Commençons par les options
newoption({
trigger = "x64",
description = "Setup build project for x64 arch"
}
})
newoption {
newoption({
trigger = "united",
description = "Builds all the modules as one united library"
}
})
newoption {
newoption({
trigger = "with-extlibs",
description = "Builds the extern libraries"
}
})
newoption {
newoption({
trigger = "with-examples",
description = "Builds the examples"
}
})
-- Puis par les bibliothèques externes
-- Puis par les bibliothèques externes
self.ExtLibs = {}
local extlibs = os.matchfiles("../extlibs/build/*.lua")
for k,v in pairs(extlibs) do
@ -300,16 +281,17 @@ function NazaraBuild:Initialize()
self.Modules = {}
local modules = os.matchfiles("scripts/module/*.lua")
for k,v in pairs(modules) do
local moduleName = v:match(".*/(.*).lua"):lower()
local moduleName = v:match(".*/(.*).lua")
local moduleNameLower = moduleName:lower()
if (moduleName ~= "core") then -- exclure le noyau n'aurait aucun sens
newoption {
trigger = "exclude-" .. moduleName,
if (moduleNameLower ~= "core") then -- exclure le noyau n'aurait aucun sens
newoption({
trigger = "exclude-" .. moduleNameLower,
description = "Exclude the " .. moduleName .. " module from the build system"
}
})
end
if (not _OPTIONS["exclude-" .. moduleName]) then
if (not _OPTIONS["exclude-" .. moduleNameLower]) then
local f, err = loadfile(v)
if (f) then
MODULE = {}