Premake: Fix BitMRC build and add shipped sqlite3 as separate project.
This commit is contained in:
parent
1c9badb4a2
commit
a7d80f7187
@ -11,6 +11,9 @@ end
|
||||
function bitmrc.import()
|
||||
if not bitmrc.settings then error("Run bitmrc.setup first") end
|
||||
|
||||
sqlite3.import()
|
||||
libcryptopp.import()
|
||||
|
||||
bitmrc.includes()
|
||||
end
|
||||
|
||||
@ -29,27 +32,27 @@ function bitmrc.project()
|
||||
includedirs
|
||||
{
|
||||
path.join(bitmrc.settings.source, "BitMRC/include"),
|
||||
path.join(bitmrc.settings.source, "BitMRC/Storage/include"),
|
||||
}
|
||||
files
|
||||
{
|
||||
path.join(bitmrc.settings.source, "BitMRC/**.cpp"),
|
||||
path.join(bitmrc.settings.source, "BitMRC/*.cpp"),
|
||||
path.join(bitmrc.settings.source, "BitMRC/Storage/*.cpp"),
|
||||
}
|
||||
removefiles
|
||||
{
|
||||
-- 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/Storage/**"),
|
||||
path.join(bitmrc.settings.source, "BitMRC/Debug/**"),
|
||||
}
|
||||
|
||||
-- dependencies
|
||||
sqlite3.import()
|
||||
libcryptopp.import()
|
||||
|
||||
-- not our code, ignore POSIX usage warnings for now
|
||||
defines { "_SCL_SECURE_NO_WARNINGS" }
|
||||
warnings "Off"
|
||||
|
||||
-- always build as static lib, as we include our custom classes and therefore can't perform shared linking
|
||||
kind "StaticLib"
|
||||
end
|
||||
|
50
premake/sqlite3.lua
Normal file
50
premake/sqlite3.lua
Normal 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
|
18
premake5.lua
18
premake5.lua
@ -125,17 +125,18 @@ newaction {
|
||||
|
||||
depsBasePath = "./deps"
|
||||
|
||||
require "premake/bitmrc"
|
||||
require "premake/fmt"
|
||||
require "premake/json11"
|
||||
require "premake/libcryptopp"
|
||||
require "premake/libtomcrypt"
|
||||
require "premake/libtommath"
|
||||
require "premake/mongoose"
|
||||
require "premake/pdcurses"
|
||||
require "premake/protobuf"
|
||||
require "premake/sqlite3"
|
||||
require "premake/winksignals"
|
||||
require "premake/zlib"
|
||||
require "premake/libcryptopp"
|
||||
require "premake/bitmrc"
|
||||
|
||||
bitmrc.setup
|
||||
{
|
||||
@ -181,6 +182,10 @@ protobuf.setup
|
||||
{
|
||||
source = path.join(depsBasePath, "protobuf"),
|
||||
}
|
||||
sqlite3.setup
|
||||
{
|
||||
source = path.join(depsBasePath, "bitmrc/windows/sqlite3"),
|
||||
}
|
||||
winksignals.setup
|
||||
{
|
||||
source = path.join(depsBasePath, "Wink-Signals"),
|
||||
@ -255,6 +260,7 @@ workspace "iw4x"
|
||||
buildoptions { "/Zm200" }
|
||||
|
||||
-- Dependency libraries
|
||||
bitmrc.import()
|
||||
fmt.import()
|
||||
json11.import()
|
||||
libtomcrypt.import()
|
||||
@ -264,8 +270,6 @@ workspace "iw4x"
|
||||
protobuf.import()
|
||||
winksignals.import()
|
||||
zlib.import()
|
||||
libcryptopp.import()
|
||||
bitmrc.import()
|
||||
|
||||
-- fix vpaths for protobuf sources
|
||||
vpaths
|
||||
@ -356,17 +360,17 @@ workspace "iw4x"
|
||||
}
|
||||
|
||||
group "External dependencies"
|
||||
bitmrc.project()
|
||||
fmt.project()
|
||||
json11.project()
|
||||
libcryptopp.project()
|
||||
libtomcrypt.project()
|
||||
libtommath.project()
|
||||
mongoose.project()
|
||||
pdcurses.project()
|
||||
protobuf.project()
|
||||
winksignals.project()
|
||||
zlib.project()
|
||||
protobuf.project()
|
||||
libcryptopp.project()
|
||||
bitmrc.project()
|
||||
|
||||
rule "ProtobufCompiler"
|
||||
display "Protobuf compiler"
|
||||
|
Loading…
Reference in New Issue
Block a user