Changeset View
Standalone View
build/premake/extern_libs5.lua
Show All 33 Lines | |||||
end | end | ||||
local function add_third_party_include_paths(extern_lib) | local function add_third_party_include_paths(extern_lib) | ||||
sysincludedirs { third_party_source_dir .. extern_lib .. "/include" } | sysincludedirs { third_party_source_dir .. extern_lib .. "/include" } | ||||
end | end | ||||
pkgconfig = require "pkgconfig" | pkgconfig = require "pkgconfig" | ||||
-- Configure pkgconfig for MacOSX systems | |||||
if os.istarget("macosx") then | |||||
pkgconfig.additional_pc_path = libraries_dir .. "pkgconfig/" | |||||
pkgconfig.static_link_libs = true | |||||
end | |||||
local function add_delayload(name, suffix, def) | local function add_delayload(name, suffix, def) | ||||
if def["no_delayload"] then | if def["no_delayload"] then | ||||
return | return | ||||
end | end | ||||
-- currently only supported by VC; nothing to do on other platforms. | -- currently only supported by VC; nothing to do on other platforms. | ||||
▲ Show 20 Lines • Show All 173 Lines • ▼ Show 20 Lines | extern_lib_defs = { | ||||
}, | }, | ||||
cxxtest = { | cxxtest = { | ||||
compile_settings = function() | compile_settings = function() | ||||
sysincludedirs { libraries_source_dir .. "cxxtest-4.4" } | sysincludedirs { libraries_source_dir .. "cxxtest-4.4" } | ||||
end, | end, | ||||
}, | }, | ||||
enet = { | enet = { | ||||
compile_settings = function() | compile_settings = function() | ||||
if os.istarget("windows") or os.istarget("macosx") then | if os.istarget("windows") then | ||||
add_default_include_paths("enet") | add_default_include_paths("enet") | ||||
else | |||||
pkgconfig.add_includes("libenet") | |||||
end | end | ||||
end, | end, | ||||
link_settings = function() | link_settings = function() | ||||
if os.istarget("windows") or os.istarget("macosx") then | if os.istarget("windows") then | ||||
add_default_lib_paths("enet") | add_default_lib_paths("enet") | ||||
end | |||||
add_default_links({ | add_default_links({ | ||||
win_names = { "enet" }, | win_names = { "enet" }, | ||||
unix_names = { "enet" }, | |||||
}) | }) | ||||
else | |||||
pkgconfig.add_links("libenet") | |||||
end | |||||
end, | end, | ||||
}, | }, | ||||
fcollada = { | fcollada = { | ||||
compile_settings = function() | compile_settings = function() | ||||
add_source_include_paths("fcollada") | add_source_include_paths("fcollada") | ||||
end, | end, | ||||
link_settings = function() | link_settings = function() | ||||
add_source_lib_paths("fcollada") | add_source_lib_paths("fcollada") | ||||
Show All 9 Lines | link_settings = function() | ||||
filter "Release" | filter "Release" | ||||
links { "FColladaSR" } | links { "FColladaSR" } | ||||
filter { } | filter { } | ||||
end | end | ||||
end, | end, | ||||
}, | }, | ||||
fmt = { | fmt = { | ||||
compile_settings = function() | compile_settings = function() | ||||
if os.istarget("windows") or os.istarget("macosx") then | if os.istarget("windows") then | ||||
add_default_include_paths("fmt") | add_default_include_paths("fmt") | ||||
elseif os.istarget("macosx") then | |||||
pkgconfig.add_includes("fmt") | |||||
end | end | ||||
-- With Linux & BSD, we assume that fmt is installed in a standard location. | -- With Linux & BSD, we assume that fmt is installed in a standard location. | ||||
-- | -- | ||||
-- It would be nice to not assume, and to instead use pkgconfig: however that | -- It would be nice to not assume, and to instead use pkgconfig: however that | ||||
-- requires fmt 5.3.0 or greater. | -- requires fmt 5.3.0 or greater. | ||||
-- | -- | ||||
-- Unfortunately (at the time of writing) only 69 out of 95 (~72.6%) of distros | -- Unfortunately (at the time of writing) only 79 out of 103 (~76.7%) of distros | ||||
-- that provide a fmt package meet this, according to | -- that provide a fmt package meet this, according to | ||||
-- https://repology.org/badge/vertical-allrepos/fmt.svg?minversion=5.3 | -- https://repology.org/badge/vertical-allrepos/fmt.svg?minversion=5.3 | ||||
-- | -- | ||||
-- Whilst that might seem like a healthy majority, this does not include the 2018 | -- Whilst that might seem like a healthy majority, this does not include the 2018 | ||||
-- Long Term Support and 2019.10 releases of Ubuntu - not only popular and widely | -- Long Term Support and 2019.10 releases of Ubuntu - not only popular and widely | ||||
-- used as-is, but which are also used as a base for other popular distros (e.g. | -- used as-is, but which are also used as a base for other popular distros (e.g. | ||||
-- Mint). | -- Mint). | ||||
-- | -- | ||||
-- When fmt 5.3 (or better) becomes more widely used, then we can safely use the | -- When fmt 5.3 (or better) becomes more widely used, then we can safely use the | ||||
-- following line: | -- same line as we currently use for osx | ||||
-- pkgconfig.add_includes("fmt") | |||||
end, | end, | ||||
link_settings = function() | link_settings = function() | ||||
if os.istarget("windows") or os.istarget("macosx") then | |||||
add_default_lib_paths("fmt") | |||||
end | |||||
if os.istarget("windows") then | if os.istarget("windows") then | ||||
add_default_lib_paths("fmt") | |||||
add_default_links({ | add_default_links({ | ||||
win_names = { "fmt" }, | win_names = { "fmt" }, | ||||
dbg_suffix = "d", | dbg_suffix = "d", | ||||
no_delayload = 1, | no_delayload = 1, | ||||
}) | }) | ||||
elseif os.istarget("macosx") then | |||||
-- See comment above as to why this is not also used on Linux or BSD. | |||||
pkgconfig.add_links("fmt") | |||||
else | else | ||||
add_default_links({ | add_default_links({ | ||||
unix_names = { "fmt" }, | unix_names = { "fmt" }, | ||||
}) | }) | ||||
-- See comment above as to why this is commented out. | |||||
-- pkgconfig.add_links("fmt") | |||||
end | end | ||||
end | end | ||||
}, | }, | ||||
gloox = { | gloox = { | ||||
compile_settings = function() | compile_settings = function() | ||||
if os.istarget("windows") then | if os.istarget("windows") then | ||||
add_default_include_paths("gloox") | add_default_include_paths("gloox") | ||||
else | else | ||||
-- Support GLOOX_CONFIG for overriding the default (pkg-config --cflags gloox) | pkgconfig.add_includes("gloox") | ||||
-- i.e. on OSX where it gets set in update-workspaces.sh | |||||
pkgconfig.add_includes("gloox", os.getenv("GLOOX_CONFIG")) | |||||
end | end | ||||
end, | end, | ||||
link_settings = function() | link_settings = function() | ||||
if os.istarget("windows") then | if os.istarget("windows") then | ||||
add_default_lib_paths("gloox") | add_default_lib_paths("gloox") | ||||
add_default_links({ | add_default_links({ | ||||
win_names = { "gloox-1.0" }, | win_names = { "gloox-1.0" }, | ||||
no_delayload = 1, | no_delayload = 1, | ||||
}) | }) | ||||
else | else | ||||
pkgconfig.add_links("gloox", os.getenv("GLOOX_CONFIG")) | pkgconfig.add_links("gloox") | ||||
if os.istarget("macosx") then | if os.istarget("macosx") then | ||||
-- Manually add gnutls dependencies, those are not present in gloox's pkg-config | -- gloox depends on gnutls, but doesn't identify this via pkg-config | ||||
add_default_lib_paths("nettle") | pkgconfig.add_links("gnutls") | ||||
add_default_lib_paths("gmp") | |||||
add_default_links({ | |||||
osx_names = { "nettle", "hogweed", "gmp" }, | |||||
}) | |||||
end | end | ||||
end | end | ||||
end, | end, | ||||
}, | }, | ||||
iconv = { | iconv = { | ||||
compile_settings = function() | compile_settings = function() | ||||
if os.istarget("windows") then | if os.istarget("windows") then | ||||
add_default_include_paths("iconv") | add_default_include_paths("iconv") | ||||
defines { "HAVE_ICONV_CONST" } | defines { "HAVE_ICONV_CONST" } | ||||
Show All 20 Lines | link_settings = function() | ||||
-- glibc (used on Linux and GNU/kFreeBSD) has iconv | -- glibc (used on Linux and GNU/kFreeBSD) has iconv | ||||
end, | end, | ||||
}, | }, | ||||
icu = { | icu = { | ||||
compile_settings = function() | compile_settings = function() | ||||
if os.istarget("windows") then | if os.istarget("windows") then | ||||
add_default_include_paths("icu") | add_default_include_paths("icu") | ||||
else | else | ||||
-- Support ICU_CONFIG for overriding the default (pkg-config --cflags icu-i18n) | pkgconfig.add_includes("icu-i18n") | ||||
-- i.e. on OSX where it gets set in update-workspaces.sh | |||||
pkgconfig.add_includes("icu-i18n", os.getenv("ICU_CONFIG"), "--cppflags") | |||||
end | end | ||||
end, | end, | ||||
link_settings = function() | link_settings = function() | ||||
if os.istarget("windows") then | if os.istarget("windows") then | ||||
add_default_lib_paths("icu") | add_default_lib_paths("icu") | ||||
add_default_links({ | add_default_links({ | ||||
win_names = { "icuuc", "icuin" }, | win_names = { "icuuc", "icuin" }, | ||||
dbg_suffix = "", | dbg_suffix = "", | ||||
no_delayload = 1, | no_delayload = 1, | ||||
}) | }) | ||||
else | else | ||||
pkgconfig.add_links("icu-i18n", os.getenv("ICU_CONFIG"), "--ldflags-searchpath --ldflags-libsonly --ldflags-system") | pkgconfig.add_links("icu-i18n") | ||||
end | end | ||||
end, | end, | ||||
}, | }, | ||||
libcurl = { | libcurl = { | ||||
compile_settings = function() | compile_settings = function() | ||||
if os.istarget("windows") or os.istarget("macosx") then | if os.istarget("windows") then | ||||
add_default_include_paths("libcurl") | add_default_include_paths("libcurl") | ||||
else | |||||
pkgconfig.add_includes("libcurl") | |||||
end | end | ||||
end, | end, | ||||
link_settings = function() | link_settings = function() | ||||
if os.istarget("windows") or os.istarget("macosx") then | if os.istarget("windows") then | ||||
add_default_lib_paths("libcurl") | add_default_lib_paths("libcurl") | ||||
else | |||||
pkgconfig.add_links("libcurl") | |||||
end | end | ||||
add_default_links({ | add_default_links({ | ||||
win_names = { "libcurl" }, | win_names = { "libcurl" }, | ||||
unix_names = { "curl" }, | osx_frameworks = { "Security" }, -- Not supplied by curl's pkg-config | ||||
osx_names = { "curl", "z" }, | |||||
osx_frameworks = { "Security" } | |||||
}) | }) | ||||
end, | end, | ||||
}, | }, | ||||
libpng = { | libpng = { | ||||
compile_settings = function() | compile_settings = function() | ||||
if os.istarget("windows") or os.istarget("macosx") then | if os.istarget("windows") then | ||||
add_default_include_paths("libpng") | add_default_include_paths("libpng") | ||||
end | else | ||||
if os.getversion().description == "OpenBSD" then | pkgconfig.add_includes("libpng") | ||||
sysincludedirs { "/usr/local/include/libpng" } | |||||
end | end | ||||
end, | end, | ||||
link_settings = function() | link_settings = function() | ||||
if os.istarget("windows") or os.istarget("macosx") then | if os.istarget("windows") then | ||||
add_default_lib_paths("libpng") | add_default_lib_paths("libpng") | ||||
end | |||||
add_default_links({ | add_default_links({ | ||||
win_names = { "libpng16" }, | win_names = { "libpng16" }, | ||||
unix_names = { "png" }, | |||||
-- Otherwise ld will sometimes pull in ancient 1.2 from the SDK, which breaks the build :/ | |||||
-- TODO: Figure out why that happens | |||||
osx_names = { "png16" }, | |||||
}) | }) | ||||
else | |||||
pkgconfig.add_links("libpng") | |||||
end | |||||
end, | end, | ||||
}, | }, | ||||
libsodium = { | libsodium = { | ||||
compile_settings = function() | compile_settings = function() | ||||
if os.istarget("windows") or os.istarget("macosx") then | if os.istarget("windows") then | ||||
add_default_include_paths("libsodium") | add_default_include_paths("libsodium") | ||||
else | |||||
pkgconfig.add_includes("libsodium") | |||||
end | end | ||||
end, | end, | ||||
link_settings = function() | link_settings = function() | ||||
if os.istarget("windows") or os.istarget("macosx") then | if os.istarget("windows") then | ||||
add_default_lib_paths("libsodium") | add_default_lib_paths("libsodium") | ||||
end | |||||
add_default_links({ | add_default_links({ | ||||
win_names = { "libsodium" }, | win_names = { "libsodium" }, | ||||
unix_names = { "sodium" }, | |||||
}) | }) | ||||
else | |||||
pkgconfig.add_links("libsodium") | |||||
end | |||||
end, | end, | ||||
}, | }, | ||||
libxml2 = { | libxml2 = { | ||||
compile_settings = function() | compile_settings = function() | ||||
if os.istarget("windows") then | if os.istarget("windows") then | ||||
add_default_include_paths("libxml2") | add_default_include_paths("libxml2") | ||||
else | else | ||||
-- Support XML2_CONFIG for overriding the default (pkg-config --cflags libxml-2.0) | pkgconfig.add_includes("libxml-2.0") | ||||
-- i.e. on OSX where it gets set in update-workspaces.sh | |||||
pkgconfig.add_includes("libxml-2.0", os.getenv("XML2_CONFIG")) | |||||
end | |||||
if os.istarget("macosx") then | if os.istarget("macosx") then | ||||
-- libxml2 needs _REENTRANT or __MT__ for thread support; | -- libxml2 needs _REENTRANT or __MT__ for thread support; | ||||
-- OS X doesn't get either set by default, so do it manually | -- OS X doesn't get either set by default, so do it manually | ||||
defines { "_REENTRANT" } | defines { "_REENTRANT" } | ||||
end | end | ||||
end | |||||
end, | end, | ||||
link_settings = function() | link_settings = function() | ||||
if os.istarget("windows") then | if os.istarget("windows") then | ||||
add_default_lib_paths("libxml2") | add_default_lib_paths("libxml2") | ||||
filter "Debug" | filter "Debug" | ||||
links { "libxml2" } | links { "libxml2" } | ||||
filter "Release" | filter "Release" | ||||
links { "libxml2" } | links { "libxml2" } | ||||
filter { } | filter { } | ||||
else | else | ||||
pkgconfig.add_links("libxml-2.0", os.getenv("XML2_CONFIG")) | pkgconfig.add_links("libxml-2.0") | ||||
end | end | ||||
end, | end, | ||||
}, | }, | ||||
miniupnpc = { | miniupnpc = { | ||||
compile_settings = function() | compile_settings = function() | ||||
if os.istarget("windows") or os.istarget("macosx") then | if os.istarget("windows") then | ||||
add_default_include_paths("miniupnpc") | add_default_include_paths("miniupnpc") | ||||
else | |||||
-- Users on Linux or BSD with a version of miniupnpc prior to v2.2.1 *and* with | |||||
-- miniupnpc headers installed to a location outside the standard search paths | |||||
-- (e.g. `/usr/include:/usr/local/include`) may find themselves unable to build. | |||||
-- | |||||
-- However, this shouldn't be a problem for the vast majority of users. | |||||
-- | |||||
-- (Once v2.2.1+ reaches majority spread, this comment may be removed.) | |||||
-- https://repology.org/badge/vertical-allrepos/miniupnpc.svg?minversion=2.2.1 | |||||
pkgconfig.add_includes("miniupnpc") | |||||
end | end | ||||
end, | end, | ||||
link_settings = function() | link_settings = function() | ||||
if os.istarget("windows") or os.istarget("macosx") then | if os.istarget("windows") then | ||||
add_default_lib_paths("miniupnpc") | add_default_lib_paths("miniupnpc") | ||||
end | |||||
add_default_links({ | add_default_links({ | ||||
win_names = { "miniupnpc" }, | win_names = { "miniupnpc" }, | ||||
unix_names = { "miniupnpc" }, | |||||
}) | }) | ||||
else | |||||
pkgconfig.add_links("miniupnpc") | |||||
end | |||||
end, | end, | ||||
}, | }, | ||||
Stan: How legitimate are we to require it? by adding some check in the code? | |||||
Not Done Inline ActionsSorry, could you rephrase the question? s0600204: Sorry, could you rephrase the question? | |||||
Not Done Inline ActionsI mean how legitimate are we to add a #error define just like we do for spidermonkey and nvtt requiring a specific version? I don't know if it's a frowned upon practise. If we start requiring library versions I wonder whether distros will prefer updating our deps, or deprecating our package. Stan: I mean how legitimate are we to add a #error define just like we do for spidermonkey and nvtt… | |||||
Not Done Inline ActionsWell, 0AD's a game not a critical system component: so if we started insisting, it might be easier for package repositories to just drop us than have to update however many other packages. And as for "frowned upon"... that's probably a question better aimed at a repo maintainer. I don't know how long it will take for v2.2.1 to become widespread (as it was only released Dec. 2020). It is a point to note that miniupnpc is kind of an optional dependency for us - if one sets the appropriate value in source/lib/config2.h you can build without it. In theory, anyway - I don't know if anyone's actually tried it recently. I'm also not entirely sure what game functionality would be disabled. An alternate approach might be to alter the config2.h define to have more than one "positive" result - e.g. 0 to disable, 1 to use headers as is, 2 for a pre-2.2.1 version - then alter the include-guard in source/network/NetServer.cpp accordingly. The downside is that it would require some users to have to change the value pre-compilation. s0600204: Well, 0AD's a game not a critical system component: so if we started insisting, it might be… | |||||
Not Done Inline ActionsI've actually realised I was wrong to assert that it wouldn't build on pre-2.2.1 systems if we used pkgconfig here. (Which I would have known if I'd actually tried it 🤦.) It just means that those with the miniupnpc headers installed outside the standard search paths (/usr/include and /usr/local/include for most people) will most likely run into difficulties. And there will be an unnecessary/incorrect (but valid!) path added to the header search locations. Oh, and I tried building with miniupnpc disabled via config2.h (and not including the headers and libs). Haven't the foggiest what functionality was disabled, but pyrogenesis built and ran. s0600204: I've actually realised I was wrong to assert that it wouldn't build on pre-2.2.1 systems if we… | |||||
Not Done Inline ActionsI think minipunpc is the STUN library, so you probably can't host MP over the lobby. wraitii: I think minipunpc is the STUN library, so you probably can't host MP over the lobby. | |||||
Not Done Inline ActionsMmh... it was bundled back in 2013 by JoshuaJB; STUN wasn't implemented until 2017 (D364) and appears to use gloox and enet (there's no mention of minipnpc in the revision). From what I can tell (from the attached ticket #2305), if a user disables STUN, UPnP is used instead (which is provided by miniupnpc). If both are disabled, then yeah I suppose you wouldn't be able to host. s0600204: Mmh... it was bundled back in 2013 by **JoshuaJB**; STUN wasn't implemented until 2017 (D364)… | |||||
Not Done Inline ActionsMh, you might well be right. wraitii: Mh, you might well be right. | |||||
nvtt = { | nvtt = { | ||||
compile_settings = function() | compile_settings = function() | ||||
if not _OPTIONS["with-system-nvtt"] then | if not _OPTIONS["with-system-nvtt"] then | ||||
add_source_include_paths("nvtt") | add_source_include_paths("nvtt") | ||||
end | end | ||||
defines { "NVTT_SHARED=1" } | defines { "NVTT_SHARED=1" } | ||||
end, | end, | ||||
link_settings = function() | link_settings = function() | ||||
if not _OPTIONS["with-system-nvtt"] then | if not _OPTIONS["with-system-nvtt"] then | ||||
add_source_lib_paths("nvtt") | add_source_lib_paths("nvtt") | ||||
end | end | ||||
add_default_links({ | add_default_links({ | ||||
win_names = { "nvtt" }, | win_names = { "nvtt" }, | ||||
unix_names = { "nvcore", "nvmath", "nvimage", "nvtt" }, | unix_names = { "nvcore", "nvmath", "nvimage", "nvtt" }, | ||||
osx_names = { "bc6h", "bc7", "nvcore", "nvimage", "nvmath", "nvthread", "nvtt", "squish" }, | osx_names = { "bc6h", "bc7", "nvcore", "nvimage", "nvmath", "nvthread", "nvtt", "squish" }, | ||||
dbg_suffix = "", -- for performance we always use the release-mode version | dbg_suffix = "", -- for performance we always use the release-mode version | ||||
}) | }) | ||||
end, | end, | ||||
}, | }, | ||||
openal = { | openal = { | ||||
compile_settings = function() | compile_settings = function() | ||||
if os.istarget("windows") then | if os.istarget("windows") then | ||||
add_default_include_paths("openal") | add_default_include_paths("openal") | ||||
elseif not os.istarget("macosx") then | |||||
pkgconfig.add_includes("openal") | |||||
end | end | ||||
end, | end, | ||||
link_settings = function() | link_settings = function() | ||||
if os.istarget("windows") then | if os.istarget("windows") then | ||||
add_default_lib_paths("openal") | add_default_lib_paths("openal") | ||||
end | |||||
add_default_links({ | add_default_links({ | ||||
win_names = { "openal32" }, | win_names = { "openal32" }, | ||||
unix_names = { "openal" }, | |||||
osx_frameworks = { "OpenAL" }, | |||||
dbg_suffix = "", | dbg_suffix = "", | ||||
no_delayload = 1, -- delayload seems to cause errors on startup | no_delayload = 1, -- delayload seems to cause errors on startup | ||||
}) | }) | ||||
elseif os.istarget("macosx") then | |||||
add_default_links({ | |||||
osx_frameworks = { "OpenAL" }, | |||||
}) | |||||
else | |||||
pkgconfig.add_links("openal") | |||||
end | |||||
end, | end, | ||||
}, | }, | ||||
opengl = { | opengl = { | ||||
compile_settings = function() | compile_settings = function() | ||||
if os.istarget("windows") then | if os.istarget("windows") then | ||||
add_default_include_paths("opengl") | add_default_include_paths("opengl") | ||||
elseif _OPTIONS["gles"] then | |||||
pkgconfig.add_includes("glesv2") | |||||
elseif not os.istarget("macosx") then | |||||
pkgconfig.add_includes("gl") | |||||
end | end | ||||
end, | end, | ||||
link_settings = function() | link_settings = function() | ||||
if os.istarget("windows") then | if os.istarget("windows") then | ||||
add_default_lib_paths("opengl") | add_default_lib_paths("opengl") | ||||
end | |||||
if _OPTIONS["gles"] then | |||||
add_default_links({ | add_default_links({ | ||||
unix_names = { "GLESv2" }, | win_names = { "opengl32", "gdi32" }, | ||||
dbg_suffix = "", | dbg_suffix = "", | ||||
no_delayload = 1, -- delayload seems to cause errors on startup | |||||
}) | }) | ||||
else | elseif os.istarget("macosx") then | ||||
add_default_links({ | add_default_links({ | ||||
win_names = { "opengl32", "gdi32" }, | |||||
unix_names = { "GL" }, | |||||
osx_frameworks = { "OpenGL" }, | osx_frameworks = { "OpenGL" }, | ||||
dbg_suffix = "", | |||||
no_delayload = 1, -- delayload seems to cause errors on startup | |||||
}) | }) | ||||
elseif _OPTIONS["gles"] then | |||||
pkgconfig.add_links("glesv2") | |||||
else | |||||
pkgconfig.add_links("gl") | |||||
end | end | ||||
end, | end, | ||||
}, | }, | ||||
sdl = { | sdl = { | ||||
compile_settings = function() | compile_settings = function() | ||||
if os.istarget("windows") then | if os.istarget("windows") then | ||||
includedirs { libraries_dir .. "sdl2/include/SDL" } | includedirs { libraries_dir .. "sdl2/include/SDL" } | ||||
elseif not _OPTIONS["android"] then | elseif not _OPTIONS["android"] then | ||||
-- Support SDL2_CONFIG for overriding the default (pkg-config sdl2) | pkgconfig.add_includes("sdl2") | ||||
-- i.e. on OSX where it gets set in update-workspaces.sh | |||||
pkgconfig.add_includes("sdl2", os.getenv("SDL2_CONFIG")) | |||||
end | end | ||||
end, | end, | ||||
link_settings = function() | link_settings = function() | ||||
if os.istarget("windows") then | if os.istarget("windows") then | ||||
add_default_lib_paths("sdl2") | add_default_lib_paths("sdl2") | ||||
elseif not _OPTIONS["android"] then | elseif not _OPTIONS["android"] then | ||||
pkgconfig.add_links("sdl2", os.getenv("SDL2_CONFIG")) | pkgconfig.add_links("sdl2") | ||||
end | end | ||||
end, | end, | ||||
}, | }, | ||||
spidermonkey = { | spidermonkey = { | ||||
compile_settings = function() | compile_settings = function() | ||||
if _OPTIONS["with-system-mozjs"] then | if _OPTIONS["with-system-mozjs"] then | ||||
if not _OPTIONS["android"] then | if not _OPTIONS["android"] then | ||||
pkgconfig.add_includes("mozjs-78") | pkgconfig.add_includes("mozjs-78") | ||||
▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | valgrind = { | ||||
compile_settings = function() | compile_settings = function() | ||||
add_source_include_paths("valgrind") | add_source_include_paths("valgrind") | ||||
end, | end, | ||||
}, | }, | ||||
vorbis = { | vorbis = { | ||||
compile_settings = function() | compile_settings = function() | ||||
if os.istarget("windows") then | if os.istarget("windows") then | ||||
add_default_include_paths("vorbis") | add_default_include_paths("vorbis") | ||||
elseif os.istarget("macosx") then | else | ||||
add_default_include_paths("libogg") | pkgconfig.add_includes("ogg") | ||||
add_default_include_paths("vorbis") | pkgconfig.add_includes("vorbisfile") | ||||
end | end | ||||
end, | end, | ||||
link_settings = function() | link_settings = function() | ||||
if os.istarget("windows") then | if os.istarget("windows") then | ||||
add_default_lib_paths("vorbis") | add_default_lib_paths("vorbis") | ||||
elseif os.istarget("macosx") then | add_default_links({ | ||||
add_default_lib_paths("libogg") | win_names = { "libvorbisfile" }, | ||||
add_default_lib_paths("vorbis") | }) | ||||
end | elseif os.getversion().description == "OpenBSD" then | ||||
-- TODO: We need to force linking with these as currently | -- TODO: We need to force linking with these as currently | ||||
-- they need to be loaded explicitly on execution | -- they need to be loaded explicitly on execution | ||||
if os.getversion().description == "OpenBSD" then | |||||
add_default_links({ | add_default_links({ | ||||
unix_names = { "ogg", | unix_names = { "ogg", "vorbis" }, | ||||
"vorbis" }, | |||||
}) | }) | ||||
else | |||||
pkgconfig.add_links("vorbisfile") | |||||
end | end | ||||
add_default_links({ | |||||
win_names = { "libvorbisfile" }, | |||||
unix_names = { "vorbisfile" }, | |||||
osx_names = { "vorbis", "vorbisenc", "vorbisfile", "ogg" }, | |||||
}) | |||||
end, | end, | ||||
}, | }, | ||||
wxwidgets = { | wxwidgets = { | ||||
compile_settings = function() | compile_settings = function() | ||||
if os.istarget("windows") then | if os.istarget("windows") then | ||||
includedirs { libraries_dir.."wxwidgets/include/msvc" } | includedirs { libraries_dir.."wxwidgets/include/msvc" } | ||||
add_default_include_paths("wxwidgets") | add_default_include_paths("wxwidgets") | ||||
else | else | ||||
Show All 21 Lines | x11 = { | ||||
link_settings = function() | link_settings = function() | ||||
if not os.istarget("windows") and not os.istarget("macosx") then | if not os.istarget("windows") and not os.istarget("macosx") then | ||||
pkgconfig.add_links("x11") | pkgconfig.add_links("x11") | ||||
end | end | ||||
end, | end, | ||||
}, | }, | ||||
zlib = { | zlib = { | ||||
compile_settings = function() | compile_settings = function() | ||||
if os.istarget("windows") or os.istarget("macosx") then | if os.istarget("windows") then | ||||
add_default_include_paths("zlib") | add_default_include_paths("zlib") | ||||
else | |||||
pkgconfig.add_includes("zlib") | |||||
end | end | ||||
end, | end, | ||||
link_settings = function() | link_settings = function() | ||||
if os.istarget("windows") or os.istarget("macosx") then | if os.istarget("windows") then | ||||
add_default_lib_paths("zlib") | add_default_lib_paths("zlib") | ||||
end | |||||
add_default_links({ | add_default_links({ | ||||
win_names = { "zlib1" }, | win_names = { "zlib1" }, | ||||
unix_names = { "z" }, | |||||
no_delayload = 1, | no_delayload = 1, | ||||
}) | }) | ||||
else | |||||
pkgconfig.add_links("zlib") | |||||
end | |||||
end, | end, | ||||
}, | }, | ||||
} | } | ||||
-- add a set of external libraries to the project; takes care of | -- add a set of external libraries to the project; takes care of | ||||
-- include / lib path and linking against the import library. | -- include / lib path and linking against the import library. | ||||
-- extern_libs: table of library names [string] | -- extern_libs: table of library names [string] | ||||
Show All 22 Lines |
How legitimate are we to require it? by adding some check in the code?