Changeset View
Changeset View
Standalone View
Standalone View
build/premake/premake5.lua
newoption { trigger = "android", description = "Use non-working Android cross-compiling mode" } | newoption { trigger = "android", description = "Use non-working Android cross-compiling mode" } | ||||
newoption { trigger = "atlas", description = "Include Atlas scenario editor projects" } | newoption { trigger = "atlas", description = "Include Atlas scenario editor projects" } | ||||
newoption { trigger = "coverage", description = "Enable code coverage data collection (GCC only)" } | newoption { trigger = "coverage", description = "Enable code coverage data collection (GCC only)" } | ||||
newoption { trigger = "gles", description = "Use non-working OpenGL ES 2.0 mode" } | newoption { trigger = "gles", description = "Use non-working OpenGL ES 2.0 mode" } | ||||
newoption { trigger = "icc", description = "Use Intel C++ Compiler (Linux only; should use either \"--cc icc\" or --without-pch too, and then set CXX=icpc before calling make)" } | newoption { trigger = "icc", description = "Use Intel C++ Compiler (Linux only; should use either \"--cc icc\" or --without-pch too, and then set CXX=icpc before calling make)" } | ||||
newoption { trigger = "jenkins-tests", description = "Configure CxxTest to use the XmlPrinter runner which produces Jenkins-compatible output" } | newoption { trigger = "jenkins-tests", description = "Configure CxxTest to use the XmlPrinter runner which produces Jenkins-compatible output" } | ||||
newoption { trigger = "minimal-flags", description = "Only set compiler/linker flags that are really needed. Has no effect on Windows builds" } | newoption { trigger = "minimal-flags", description = "Only set compiler/linker flags that are really needed. Has no effect on Windows builds" } | ||||
newoption { trigger = "outpath", description = "Location for generated project files" } | newoption { trigger = "outpath", description = "Location for generated project files" } | ||||
newoption { trigger = "with-system-mozjs38", description = "Search standard paths for libmozjs38, instead of using bundled copy" } | newoption { trigger = "with-system-mozjs38", description = "Search standard paths for libmozjs38, instead of using bundled copy" } | ||||
newoption { trigger = "with-system-nvtt", description = "Search standard paths for nvidia-texture-tools library, instead of using bundled copy" } | newoption { trigger = "with-system-nvtt", description = "Search standard paths for nvidia-texture-tools library, instead of using bundled copy" } | ||||
newoption { trigger = "with-system-enet", description = "Search standard paths for enet library, instead of using bundled copy" } | |||||
newoption { trigger = "without-audio", description = "Disable use of OpenAL/Ogg/Vorbis APIs" } | newoption { trigger = "without-audio", description = "Disable use of OpenAL/Ogg/Vorbis APIs" } | ||||
newoption { trigger = "without-lobby", description = "Disable the use of gloox and the multiplayer lobby" } | newoption { trigger = "without-lobby", description = "Disable the use of gloox and the multiplayer lobby" } | ||||
newoption { trigger = "without-miniupnpc", description = "Disable use of miniupnpc for port forwarding" } | newoption { trigger = "without-miniupnpc", description = "Disable use of miniupnpc for port forwarding" } | ||||
newoption { trigger = "without-nvtt", description = "Disable use of NVTT" } | newoption { trigger = "without-nvtt", description = "Disable use of NVTT" } | ||||
newoption { trigger = "without-pch", description = "Disable generation and usage of precompiled headers" } | newoption { trigger = "without-pch", description = "Disable generation and usage of precompiled headers" } | ||||
newoption { trigger = "without-tests", description = "Disable generation of test projects" } | newoption { trigger = "without-tests", description = "Disable generation of test projects" } | ||||
-- OS X specific options | -- OS X specific options | ||||
▲ Show 20 Lines • Show All 155 Lines • ▼ Show 20 Lines | function project_set_build_flags() | ||||
if _OPTIONS["without-lobby"] then | if _OPTIONS["without-lobby"] then | ||||
defines { "CONFIG2_LOBBY=0" } | defines { "CONFIG2_LOBBY=0" } | ||||
end | end | ||||
if _OPTIONS["without-miniupnpc"] then | if _OPTIONS["without-miniupnpc"] then | ||||
defines { "CONFIG2_MINIUPNPC=0" } | defines { "CONFIG2_MINIUPNPC=0" } | ||||
end | end | ||||
if _OPTIONS["with-system-enet"] then | |||||
defines { "CONFIG2_SYSTEM_ENET=1" } | |||||
end | |||||
-- required for the lowlevel library. must be set from all projects that use it, otherwise it assumes it is | -- required for the lowlevel library. must be set from all projects that use it, otherwise it assumes it is | ||||
-- being used as a DLL (which is currently not the case in 0ad) | -- being used as a DLL (which is currently not the case in 0ad) | ||||
defines { "LIB_STATIC_LINK" } | defines { "LIB_STATIC_LINK" } | ||||
-- various platform-specific build flags | -- various platform-specific build flags | ||||
if os.istarget("windows") then | if os.istarget("windows") then | ||||
flags { "MultiProcessorCompile" } | flags { "MultiProcessorCompile" } | ||||
▲ Show 20 Lines • Show All 386 Lines • ▼ Show 20 Lines | function setup_all_libs () | ||||
local extern_libs = {} | local extern_libs = {} | ||||
source_dirs = { | source_dirs = { | ||||
"network", | "network", | ||||
} | } | ||||
extern_libs = { | extern_libs = { | ||||
"spidermonkey", | "spidermonkey", | ||||
"enet", | |||||
"boost", -- dragged in via server->simulation.h->random | "boost", -- dragged in via server->simulation.h->random | ||||
} | } | ||||
if _OPTIONS["with-system-enet"] then | |||||
table.insert(extern_libs, "enet") | |||||
end | |||||
if not _OPTIONS["without-miniupnpc"] then | if not _OPTIONS["without-miniupnpc"] then | ||||
table.insert(extern_libs, "miniupnpc") | table.insert(extern_libs, "miniupnpc") | ||||
end | end | ||||
setup_static_lib_project("network", source_dirs, extern_libs, {}) | setup_static_lib_project("network", source_dirs, extern_libs, {}) | ||||
source_dirs = { | source_dirs = { | ||||
"third_party/tinygettext/src", | "third_party/tinygettext/src", | ||||
} | } | ||||
Show All 23 Lines | source_dirs = { | ||||
"lobby/scripting", | "lobby/scripting", | ||||
"i18n", | "i18n", | ||||
"third_party/encryption" | "third_party/encryption" | ||||
} | } | ||||
extern_libs = { | extern_libs = { | ||||
"spidermonkey", | "spidermonkey", | ||||
"boost", | "boost", | ||||
"enet", | |||||
"gloox", | "gloox", | ||||
"icu", | "icu", | ||||
"iconv", | "iconv", | ||||
"libsodium", | "libsodium", | ||||
"tinygettext" | "tinygettext" | ||||
} | } | ||||
if _OPTIONS["with-system-enet"] then | |||||
table.insert(extern_libs, "enet") | |||||
end | |||||
setup_static_lib_project("lobby", source_dirs, extern_libs, {}) | setup_static_lib_project("lobby", source_dirs, extern_libs, {}) | ||||
if _OPTIONS["use-shared-glooxwrapper"] and not _OPTIONS["build-shared-glooxwrapper"] then | if _OPTIONS["use-shared-glooxwrapper"] and not _OPTIONS["build-shared-glooxwrapper"] then | ||||
table.insert(static_lib_names_debug, "glooxwrapper_dbg") | table.insert(static_lib_names_debug, "glooxwrapper_dbg") | ||||
table.insert(static_lib_names_release, "glooxwrapper") | table.insert(static_lib_names_release, "glooxwrapper") | ||||
else | else | ||||
source_dirs = { | source_dirs = { | ||||
"lobby/glooxwrapper", | "lobby/glooxwrapper", | ||||
▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | function setup_all_libs () | ||||
} | } | ||||
extern_libs = { | extern_libs = { | ||||
"spidermonkey", | "spidermonkey", | ||||
"sdl", -- key definitions | "sdl", -- key definitions | ||||
"libxml2", | "libxml2", | ||||
"opengl", | "opengl", | ||||
"zlib", | "zlib", | ||||
"boost", | "boost", | ||||
"enet", | |||||
"libcurl", | "libcurl", | ||||
"tinygettext", | "tinygettext", | ||||
"icu", | "icu", | ||||
"iconv", | "iconv", | ||||
"libsodium", | "libsodium", | ||||
} | } | ||||
if _OPTIONS["with-system-enet"] then | |||||
table.insert(extern_libs, "enet") | |||||
end | |||||
if not _OPTIONS["without-audio"] then | if not _OPTIONS["without-audio"] then | ||||
table.insert(extern_libs, "openal") | table.insert(extern_libs, "openal") | ||||
table.insert(extern_libs, "vorbis") | table.insert(extern_libs, "vorbis") | ||||
end | end | ||||
setup_static_lib_project("engine", source_dirs, extern_libs, {}) | setup_static_lib_project("engine", source_dirs, extern_libs, {}) | ||||
Show All 34 Lines | source_dirs = { | ||||
"gui/scripting", | "gui/scripting", | ||||
"i18n" | "i18n" | ||||
} | } | ||||
extern_libs = { | extern_libs = { | ||||
"spidermonkey", | "spidermonkey", | ||||
"sdl", -- key definitions | "sdl", -- key definitions | ||||
"opengl", | "opengl", | ||||
"boost", | "boost", | ||||
"enet", | |||||
"tinygettext", | "tinygettext", | ||||
"icu", | "icu", | ||||
"iconv", | "iconv", | ||||
} | } | ||||
if _OPTIONS["with-system-enet"] then | |||||
table.insert(extern_libs, "enet") | |||||
end | |||||
if not _OPTIONS["without-audio"] then | if not _OPTIONS["without-audio"] then | ||||
table.insert(extern_libs, "openal") | table.insert(extern_libs, "openal") | ||||
end | end | ||||
setup_static_lib_project("gui", source_dirs, extern_libs, {}) | setup_static_lib_project("gui", source_dirs, extern_libs, {}) | ||||
source_dirs = { | source_dirs = { | ||||
"lib", | "lib", | ||||
▲ Show 20 Lines • Show All 79 Lines • ▼ Show 20 Lines | function setup_all_libs () | ||||
-- not built externally and then linked | -- not built externally and then linked | ||||
source_dirs = { | source_dirs = { | ||||
"third_party/mongoose", | "third_party/mongoose", | ||||
} | } | ||||
extern_libs = { | extern_libs = { | ||||
} | } | ||||
setup_static_lib_project("mongoose", source_dirs, extern_libs, { no_pch = 1 }) | setup_static_lib_project("mongoose", source_dirs, extern_libs, { no_pch = 1 }) | ||||
if not _OPTIONS["with-system-enet"] then | |||||
source_dirs = { | |||||
"third_party/enet", | |||||
} | |||||
extern_libs = { | |||||
} | |||||
setup_static_lib_project("enet", source_dirs, extern_libs, { no_pch = 1 }) | |||||
end | |||||
-- CxxTest mock function support | -- CxxTest mock function support | ||||
extern_libs = { | extern_libs = { | ||||
"boost", | "boost", | ||||
"cxxtest", | "cxxtest", | ||||
} | } | ||||
-- 'real' implementations, to be linked against the main executable | -- 'real' implementations, to be linked against the main executable | ||||
Show All 19 Lines | used_extern_libs = { | ||||
"zlib", | "zlib", | ||||
"spidermonkey", | "spidermonkey", | ||||
"libxml2", | "libxml2", | ||||
"boost", | "boost", | ||||
"cxxtest", | "cxxtest", | ||||
"comsuppw", | "comsuppw", | ||||
"enet", | |||||
"libcurl", | "libcurl", | ||||
"tinygettext", | "tinygettext", | ||||
"icu", | "icu", | ||||
"iconv", | "iconv", | ||||
"libsodium", | "libsodium", | ||||
"valgrind", | "valgrind", | ||||
} | } | ||||
if _OPTIONS["with-system-enet"] then | |||||
table.insert(used_extern_libs, "enet") | |||||
end | |||||
if not os.istarget("windows") and not _OPTIONS["android"] and not os.istarget("macosx") then | if not os.istarget("windows") and not _OPTIONS["android"] and not os.istarget("macosx") then | ||||
-- X11 should only be linked on *nix | -- X11 should only be linked on *nix | ||||
table.insert(used_extern_libs, "x11") | table.insert(used_extern_libs, "x11") | ||||
table.insert(used_extern_libs, "xcursor") | table.insert(used_extern_libs, "xcursor") | ||||
end | end | ||||
if not _OPTIONS["without-audio"] then | if not _OPTIONS["without-audio"] then | ||||
table.insert(used_extern_libs, "openal") | table.insert(used_extern_libs, "openal") | ||||
▲ Show 20 Lines • Show All 523 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator