7ff05580c9
All dependency projects are now separated into their own Premake scripts and are designed to provide easy "import", "includes" and "setup" functions. First, you use project.setup { ... } to provide the library with its respective configuration, this MAY include defines and MUST include the source path of that specific library. Then you can use project.includes() or project.import() in your target application or library project to let the script configure your project. This will configure all necessary include directories and links.
45 lines
790 B
Lua
45 lines
790 B
Lua
fmt = {
|
|
settings = nil
|
|
}
|
|
|
|
function fmt.setup(settings)
|
|
if not settings.source then error("Missing source.") end
|
|
|
|
fmt.settings = settings
|
|
end
|
|
|
|
function fmt.import()
|
|
if not fmt.settings then error("Run fmt.setup first") end
|
|
|
|
links { "fmt" }
|
|
fmt.includes()
|
|
end
|
|
|
|
function fmt.includes()
|
|
if not fmt.settings then error("Run fmt.setup first") end
|
|
|
|
includedirs { fmt.settings.source }
|
|
end
|
|
|
|
function fmt.project()
|
|
if not fmt.settings then error("Run fmt.setup first") end
|
|
|
|
project "fmt"
|
|
language "C++"
|
|
|
|
fmt.includes()
|
|
|
|
files
|
|
{
|
|
path.join(fmt.settings.source, "fmt/*.cc"),
|
|
path.join(fmt.settings.source, "fmt/*.h"),
|
|
}
|
|
|
|
-- not our code, ignore POSIX usage warnings for now
|
|
warnings "Off"
|
|
|
|
defines { "_LIB" }
|
|
removedefines { "_USRDLL", "_DLL" }
|
|
kind "StaticLib"
|
|
end
|