Merge pull request #166 from dcourtois/contrib_as_options
3rd party libraries are now options
This commit is contained in:
commit
8e37948ba1
43
premake5.lua
43
premake5.lua
@ -17,13 +17,6 @@
|
||||
|
||||
premake.api.deprecations "off"
|
||||
|
||||
--
|
||||
-- Enable contrib support for 3rd party libraries
|
||||
-- Curl includes support for http / https downloads
|
||||
-- Compression will eventually include support for ZLib / Zip
|
||||
|
||||
local ENABLE_CURL = false
|
||||
local ENABLE_COMPRESSION = true
|
||||
|
||||
--
|
||||
-- Register supporting actions and options.
|
||||
@ -69,6 +62,18 @@
|
||||
}
|
||||
|
||||
|
||||
newoption {
|
||||
trigger = "no-curl",
|
||||
description = "Disable Curl 3rd party lib"
|
||||
}
|
||||
|
||||
|
||||
newoption {
|
||||
trigger = "no-zlib",
|
||||
description = "Disable Zlib/Zip 3rd party lib"
|
||||
}
|
||||
|
||||
|
||||
|
||||
--
|
||||
-- Define the project. Put the release configuration first so it will be the
|
||||
@ -88,12 +93,14 @@
|
||||
kind "ConsoleApp"
|
||||
flags { "No64BitChecks", "ExtraWarnings", "StaticRuntime" }
|
||||
includedirs { "src/host/lua-5.1.4/src" }
|
||||
if ENABLE_COMPRESSION then
|
||||
|
||||
-- optional 3rd party libraries
|
||||
if not _OPTIONS["no-zlib"] then
|
||||
includedirs { "contrib/zlib", "contrib/libzip" }
|
||||
defines { "PREMAKE_COMPRESSION" }
|
||||
links { "zip-lib", "zlib-lib" }
|
||||
end
|
||||
if ENABLE_CURL then
|
||||
if not _OPTIONS["no-curl"] then
|
||||
includedirs { "contrib/curl/include" }
|
||||
defines { "CURL_STATICLIB", "PREMAKE_CURL" }
|
||||
links { "curl-lib" }
|
||||
@ -161,15 +168,17 @@
|
||||
defines { "LUA_USE_POSIX", "LUA_USE_DLOPEN" }
|
||||
links { "m" }
|
||||
|
||||
-- optional 3rd party libraries
|
||||
group "contrib"
|
||||
if not _OPTIONS["no-zlib"] then
|
||||
include "contrib/zlib"
|
||||
include "contrib/libzip"
|
||||
end
|
||||
if not _OPTIONS["no-curl"] then
|
||||
include "contrib/curl"
|
||||
end
|
||||
|
||||
|
||||
group 'contrib'
|
||||
if ENABLE_COMPRESSION then
|
||||
include 'contrib/zlib'
|
||||
include 'contrib/libzip'
|
||||
end
|
||||
if ENABLE_CURL then
|
||||
include 'contrib/curl'
|
||||
end
|
||||
--
|
||||
-- A more thorough cleanup.
|
||||
--
|
||||
|
Reference in New Issue
Block a user