Premake: Fix BitMRC build and add shipped sqlite3 as separate project.

This commit is contained in:
/dev/urandom 2016-08-26 20:51:20 +02:00
parent 1c9badb4a2
commit a7d80f7187
No known key found for this signature in database
GPG Key ID: 41322B973E0F295E
3 changed files with 70 additions and 13 deletions

View File

@ -11,6 +11,9 @@ end
function bitmrc.import() function bitmrc.import()
if not bitmrc.settings then error("Run bitmrc.setup first") end if not bitmrc.settings then error("Run bitmrc.setup first") end
sqlite3.import()
libcryptopp.import()
bitmrc.includes() bitmrc.includes()
end end
@ -29,27 +32,27 @@ function bitmrc.project()
includedirs includedirs
{ {
path.join(bitmrc.settings.source, "BitMRC/include"), path.join(bitmrc.settings.source, "BitMRC/include"),
path.join(bitmrc.settings.source, "BitMRC/Storage/include"),
} }
files files
{ {
path.join(bitmrc.settings.source, "BitMRC/**.cpp"), path.join(bitmrc.settings.source, "BitMRC/*.cpp"),
path.join(bitmrc.settings.source, "BitMRC/Storage/*.cpp"),
} }
removefiles removefiles
{ {
-- path.join(bitmrc.settings.source, "src/**/*test.cc"), -- path.join(bitmrc.settings.source, "src/**/*test.cc"),
path.join(bitmrc.settings.source, "BitMRC/main.cpp"), path.join(bitmrc.settings.source, "BitMRC/main.*"),
path.join(bitmrc.settings.source, "BitMRC/class.*"),
path.join(bitmrc.settings.source, "BitMRC/tests/**"), path.join(bitmrc.settings.source, "BitMRC/tests/**"),
path.join(bitmrc.settings.source, "BitMRC/Storage/**"),
path.join(bitmrc.settings.source, "BitMRC/Debug/**"),
} }
-- dependencies -- dependencies
sqlite3.import()
libcryptopp.import() libcryptopp.import()
-- not our code, ignore POSIX usage warnings for now
defines { "_SCL_SECURE_NO_WARNINGS" } defines { "_SCL_SECURE_NO_WARNINGS" }
warnings "Off" warnings "Off"
-- always build as static lib, as we include our custom classes and therefore can't perform shared linking
kind "StaticLib" kind "StaticLib"
end end

50
premake/sqlite3.lua Normal file
View File

@ -0,0 +1,50 @@
sqlite3 = {
settings = nil,
}
function sqlite3.setup(settings)
if not settings.source then error("Missing source.") end
sqlite3.settings = settings
end
function sqlite3.import()
if not sqlite3.settings then error("Run sqlite3.setup first") end
links { "sqlite3" }
sqlite3.includes()
end
function sqlite3.includes()
if not sqlite3.settings then error("Run sqlite3.setup first") end
includedirs { sqlite3.settings.source }
end
function sqlite3.project()
if not sqlite3.settings then error("Run sqlite3.setup first") end
project "sqlite3"
language "C++"
includedirs
{
sqlite3.settings.source,
}
files
{
path.join(sqlite3.settings.source, "*.c"),
path.join(sqlite3.settings.source, "*.h"),
}
-- not our code, ignore POSIX usage warnings for now
warnings "Off"
kind "SharedLib"
filter "*Static"
kind "StaticLib"
filter "kind:StaticLib"
defines { "_LIB" }
removedefines { "_USRDLL", "_DLL" }
end

View File

@ -125,17 +125,18 @@ newaction {
depsBasePath = "./deps" depsBasePath = "./deps"
require "premake/bitmrc"
require "premake/fmt" require "premake/fmt"
require "premake/json11" require "premake/json11"
require "premake/libcryptopp"
require "premake/libtomcrypt" require "premake/libtomcrypt"
require "premake/libtommath" require "premake/libtommath"
require "premake/mongoose" require "premake/mongoose"
require "premake/pdcurses" require "premake/pdcurses"
require "premake/protobuf" require "premake/protobuf"
require "premake/sqlite3"
require "premake/winksignals" require "premake/winksignals"
require "premake/zlib" require "premake/zlib"
require "premake/libcryptopp"
require "premake/bitmrc"
bitmrc.setup bitmrc.setup
{ {
@ -181,6 +182,10 @@ protobuf.setup
{ {
source = path.join(depsBasePath, "protobuf"), source = path.join(depsBasePath, "protobuf"),
} }
sqlite3.setup
{
source = path.join(depsBasePath, "bitmrc/windows/sqlite3"),
}
winksignals.setup winksignals.setup
{ {
source = path.join(depsBasePath, "Wink-Signals"), source = path.join(depsBasePath, "Wink-Signals"),
@ -255,6 +260,7 @@ workspace "iw4x"
buildoptions { "/Zm200" } buildoptions { "/Zm200" }
-- Dependency libraries -- Dependency libraries
bitmrc.import()
fmt.import() fmt.import()
json11.import() json11.import()
libtomcrypt.import() libtomcrypt.import()
@ -264,8 +270,6 @@ workspace "iw4x"
protobuf.import() protobuf.import()
winksignals.import() winksignals.import()
zlib.import() zlib.import()
libcryptopp.import()
bitmrc.import()
-- fix vpaths for protobuf sources -- fix vpaths for protobuf sources
vpaths vpaths
@ -356,17 +360,17 @@ workspace "iw4x"
} }
group "External dependencies" group "External dependencies"
bitmrc.project()
fmt.project() fmt.project()
json11.project() json11.project()
libcryptopp.project()
libtomcrypt.project() libtomcrypt.project()
libtommath.project() libtommath.project()
mongoose.project() mongoose.project()
pdcurses.project() pdcurses.project()
protobuf.project()
winksignals.project() winksignals.project()
zlib.project() zlib.project()
protobuf.project()
libcryptopp.project()
bitmrc.project()
rule "ProtobufCompiler" rule "ProtobufCompiler"
display "Protobuf compiler" display "Protobuf compiler"