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 build/scripts/features/index.html
# Codeblocks # Codeblocks
*.cbp build/**/*.cbp
*.cbTemp build/**/*.cbp
*.cscope_file_list build/**/*.cbTemp
*.depend build/**/*.cscope_file_list
*.layout build/**/*.depend
*.workspace build/**/*.layout
build/**/*.workspace
# CodeLite # CodeLite
*.project build/**/*.project
# Visual Studio # Visual Studio
*.filters build/**/*.filters
*.vcxproj build/**/*.vcxproj
*.tlog build/**/*.tlog
*.sln build/**/*.sln
*.vcxprojResolveAssemblyReference.cache build/**/*.vcxprojResolveAssemblyReference.cache
*.exp build/**/*.nativecodeanalysis.all.xml
*.nativecodeanalysis.all.xml build/**/*.nativecodeanalysis.xml
*.nativecodeanalysis.xml lib/*.exp
# Compiled Object files # Compiled Object files
*.slo build/**/*.slo
*.lo build/**/*.lo
*.o build/**/*.o
*.obj build/**/*.obj
# Compiled Dynamic libraries # Compiled Dynamic libraries
*.so build/**/*.so
*.lib lib/*.lib
# Compiled Static libraries # Compiled Static libraries
*.lai build/**/*.lai
*.la build/**/*.la
# Object files # Object files
*.o build/**/*.o
# Windows image file caches # Windows image file caches
Thumbs.db Thumbs.db

View File

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

View File

@ -1,231 +1,60 @@
local PosixOSes = {"bsd", "linux", "macosx", "solaris"} 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() 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 return -- Alors l'utilisateur voulait probablement savoir comment utiliser le programme, on ne fait rien
end end
if (self.Actions[_ACTION] ~= nil) then if (self.Actions[_ACTION] ~= nil) then
self.Actions[_ACTION].Function() self.Actions[_ACTION].Function()
else 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 if (_OPTIONS["with-extlibs"]) then
solution "NazaraExtlibs" solution("NazaraExtlibs")
-- Configuration générale -- Configuration générale
configurations configurations({
{
"DebugStatic", "DebugStatic",
"ReleaseStatic" "ReleaseStatic"
} })
location("../extlibs/build/" .. _ACTION) includedirs("../extlibs/include")
includedirs "../extlibs/include" location(_ACTION)
kind "StaticLib" kind("StaticLib")
if (_OPTIONS["x64"]) then if (_OPTIONS["x64"]) then
libdirs "../extlibs/lib/x64" libdirs("../extlibs/lib/x64")
targetdir "../extlibs/lib/x64" targetdir("../extlibs/lib/x64")
else else
libdirs "../extlibs/lib/x86" libdirs("../extlibs/lib/x86")
targetdir "../extlibs/lib/x86" targetdir("../extlibs/lib/x86")
end end
configuration "Debug*" configuration("Debug*")
flags "Symbols" flags("Symbols")
configuration "Release*" configuration("Release*")
flags { "EnableSSE2", "Optimize", "OptimizeSpeed", "NoFramePointer", "NoRTTI" } flags({"EnableSSE2", "Optimize", "OptimizeSpeed", "NoFramePointer", "NoRTTI"})
configuration { "Release*", "codeblocks or codelite or gmake or xcode3 or xcode4" } configuration({"Release*", "codeblocks or codelite or gmake or xcode3 or xcode4"})
buildoptions "-mfpmath=sse" -- Utilisation du SSE pour les calculs flottants buildoptions("-mfpmath=sse") -- Utilisation du SSE pour les calculs flottants
buildoptions "-ftree-vectorize" -- Activation de la vectorisation du code buildoptions("-ftree-vectorize") -- Activation de la vectorisation du code
configuration "DebugStatic" configuration("DebugStatic")
targetsuffix "-s-d" targetsuffix("-s-d")
configuration "ReleaseStatic" configuration("ReleaseStatic")
targetsuffix "-s" targetsuffix("-s")
configuration "codeblocks or codelite or gmake or xcode3 or xcode4" configuration("codeblocks or codelite or gmake or xcode3 or xcode4")
buildoptions "-std=c++11" buildoptions("-std=c++11")
for i=1, #self.ExtLibs do for i=1, #self.ExtLibs do
local libTable = self.ExtLibs[i] local libTable = self.ExtLibs[i]
project(libTable.Name) project(libTable.Name)
language(libTable.Language) language(libTable.Language)
location(_ACTION .. "/extlibs")
files(libTable.Files) files(libTable.Files)
excludes(libTable.FilesExclusion) excludes(libTable.FilesExclusion)
@ -238,33 +67,185 @@ function NazaraBuild:Execute()
configuration(k) configuration(k)
links(v) links(v)
end 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 end
end end
function NazaraBuild:Initialize() function NazaraBuild:Initialize()
-- Commençons par les options -- Commençons par les options
newoption { newoption({
trigger = "x64", trigger = "x64",
description = "Setup build project for x64 arch" description = "Setup build project for x64 arch"
} })
newoption { newoption({
trigger = "united", trigger = "united",
description = "Builds all the modules as one united library" description = "Builds all the modules as one united library"
} })
newoption { newoption({
trigger = "with-extlibs", trigger = "with-extlibs",
description = "Builds the extern libraries" description = "Builds the extern libraries"
} })
newoption { newoption({
trigger = "with-examples", trigger = "with-examples",
description = "Builds the examples" description = "Builds the examples"
} })
-- Puis par les bibliothèques externes -- Puis par les bibliothèques externes
self.ExtLibs = {} self.ExtLibs = {}
local extlibs = os.matchfiles("../extlibs/build/*.lua") local extlibs = os.matchfiles("../extlibs/build/*.lua")
for k,v in pairs(extlibs) do for k,v in pairs(extlibs) do
@ -300,16 +281,17 @@ function NazaraBuild:Initialize()
self.Modules = {} self.Modules = {}
local modules = os.matchfiles("scripts/module/*.lua") local modules = os.matchfiles("scripts/module/*.lua")
for k,v in pairs(modules) do 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 if (moduleNameLower ~= "core") then -- exclure le noyau n'aurait aucun sens
newoption { newoption({
trigger = "exclude-" .. moduleName, trigger = "exclude-" .. moduleNameLower,
description = "Exclude the " .. moduleName .. " module from the build system" description = "Exclude the " .. moduleName .. " module from the build system"
} })
end end
if (not _OPTIONS["exclude-" .. moduleName]) then if (not _OPTIONS["exclude-" .. moduleNameLower]) then
local f, err = loadfile(v) local f, err = loadfile(v)
if (f) then if (f) then
MODULE = {} MODULE = {}