Update Premake for Android
This was SVN commit r11076.
This commit is contained in:
parent
20d23eb340
commit
ff7653d012
@ -105,6 +105,8 @@ local function add_default_links(def)
|
|||||||
if def.win_names then
|
if def.win_names then
|
||||||
names = def.win_names
|
names = def.win_names
|
||||||
end
|
end
|
||||||
|
elseif _OPTIONS["android"] and def.android_names then
|
||||||
|
names = def.android_names
|
||||||
elseif os.is("linux") and def.linux_names then
|
elseif os.is("linux") and def.linux_names then
|
||||||
names = def.linux_names
|
names = def.linux_names
|
||||||
elseif os.is("macosx") and def.osx_names then
|
elseif os.is("macosx") and def.osx_names then
|
||||||
@ -215,8 +217,8 @@ extern_lib_defs = {
|
|||||||
add_default_lib_paths("boost")
|
add_default_lib_paths("boost")
|
||||||
end
|
end
|
||||||
add_default_links({
|
add_default_links({
|
||||||
|
android_names = { "boost_signals-gcc-mt", "boost_filesystem-gcc-mt", "boost_system-gcc-mt" },
|
||||||
unix_names = { "boost_signals-mt", "boost_filesystem-mt", "boost_system-mt" },
|
unix_names = { "boost_signals-mt", "boost_filesystem-mt", "boost_system-mt" },
|
||||||
osx_names = { "boost_signals-mt", "boost_filesystem-mt", "boost_system-mt" },
|
|
||||||
bsd_names = { "boost_signals", "boost_filesystem", "boost_system" },
|
bsd_names = { "boost_signals", "boost_filesystem", "boost_system" },
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
@ -477,7 +479,9 @@ extern_lib_defs = {
|
|||||||
spidermonkey = {
|
spidermonkey = {
|
||||||
compile_settings = function()
|
compile_settings = function()
|
||||||
if _OPTIONS["with-system-mozjs185"] then
|
if _OPTIONS["with-system-mozjs185"] then
|
||||||
pkgconfig_cflags("mozjs185")
|
if not _OPTIONS["android"] then
|
||||||
|
pkgconfig_cflags("mozjs185")
|
||||||
|
end
|
||||||
defines { "WITH_SYSTEM_MOZJS185" }
|
defines { "WITH_SYSTEM_MOZJS185" }
|
||||||
else
|
else
|
||||||
if os.is("windows") then
|
if os.is("windows") then
|
||||||
@ -494,7 +498,11 @@ extern_lib_defs = {
|
|||||||
end,
|
end,
|
||||||
link_settings = function()
|
link_settings = function()
|
||||||
if _OPTIONS["with-system-mozjs185"] then
|
if _OPTIONS["with-system-mozjs185"] then
|
||||||
pkgconfig_libs("mozjs185")
|
if _OPTIONS["android"] then
|
||||||
|
links { "mozjs185-1.0" }
|
||||||
|
else
|
||||||
|
pkgconfig_libs("mozjs185")
|
||||||
|
end
|
||||||
else
|
else
|
||||||
configuration "Debug"
|
configuration "Debug"
|
||||||
links { "mozjs185-ps-debug" }
|
links { "mozjs185-ps-debug" }
|
||||||
|
@ -7,6 +7,7 @@ newoption { trigger = "icc", description = "Use Intel C++ Compiler (Linux only;
|
|||||||
newoption { trigger = "outpath", description = "Location for generated project files" }
|
newoption { trigger = "outpath", description = "Location for generated project files" }
|
||||||
newoption { trigger = "without-fam", description = "Disable use of FAM API on Linux" }
|
newoption { trigger = "without-fam", description = "Disable use of FAM API on Linux" }
|
||||||
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-nvtt", description = "Disable use of NVTT" }
|
||||||
newoption { trigger = "without-tests", description = "Disable generation of test projects" }
|
newoption { trigger = "without-tests", description = "Disable generation of test projects" }
|
||||||
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 = "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" }
|
||||||
@ -160,6 +161,10 @@ function project_set_build_flags()
|
|||||||
defines { "CONFIG2_AUDIO=0" }
|
defines { "CONFIG2_AUDIO=0" }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if _OPTIONS["without-nvtt"] then
|
||||||
|
defines { "CONFIG2_NVTT=0" }
|
||||||
|
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" }
|
||||||
@ -235,6 +240,9 @@ function project_set_build_flags()
|
|||||||
if arch == "arm" then
|
if arch == "arm" then
|
||||||
-- disable warnings about va_list ABI change
|
-- disable warnings about va_list ABI change
|
||||||
buildoptions { "-Wno-psabi" }
|
buildoptions { "-Wno-psabi" }
|
||||||
|
|
||||||
|
-- target Cortex-A9 CPUs with NEON
|
||||||
|
buildoptions { "-mthumb -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=softfp" }
|
||||||
end
|
end
|
||||||
|
|
||||||
if os.is("linux") or os.is("bsd") then
|
if os.is("linux") or os.is("bsd") then
|
||||||
@ -325,7 +333,9 @@ end
|
|||||||
-- Windows opens a console in the background if it's set to ConsoleApp, which is not what we want.
|
-- Windows opens a console in the background if it's set to ConsoleApp, which is not what we want.
|
||||||
-- I didn't check if this setting matters for linux, but WindowedApp works there.
|
-- I didn't check if this setting matters for linux, but WindowedApp works there.
|
||||||
function get_main_project_target_type()
|
function get_main_project_target_type()
|
||||||
if os.is("macosx") then
|
if _OPTIONS["android"] then
|
||||||
|
return "SharedLib"
|
||||||
|
elseif os.is("macosx") then
|
||||||
return "ConsoleApp"
|
return "ConsoleApp"
|
||||||
else
|
else
|
||||||
return "WindowedApp"
|
return "WindowedApp"
|
||||||
@ -533,12 +543,14 @@ function setup_all_libs ()
|
|||||||
"renderer"
|
"renderer"
|
||||||
}
|
}
|
||||||
extern_libs = {
|
extern_libs = {
|
||||||
"nvtt",
|
|
||||||
"opengl",
|
"opengl",
|
||||||
"sdl", -- key definitions
|
"sdl", -- key definitions
|
||||||
"spidermonkey", -- for graphics/scripting
|
"spidermonkey", -- for graphics/scripting
|
||||||
"boost"
|
"boost"
|
||||||
}
|
}
|
||||||
|
if not _OPTIONS["without-nvtt"] then
|
||||||
|
table.insert(extern_libs, "nvtt")
|
||||||
|
end
|
||||||
setup_static_lib_project("graphics", source_dirs, extern_libs, {})
|
setup_static_lib_project("graphics", source_dirs, extern_libs, {})
|
||||||
|
|
||||||
|
|
||||||
@ -592,13 +604,16 @@ function setup_all_libs ()
|
|||||||
"opengl",
|
"opengl",
|
||||||
"libpng",
|
"libpng",
|
||||||
"zlib",
|
"zlib",
|
||||||
"openal",
|
|
||||||
"vorbis",
|
|
||||||
"libjpg",
|
"libjpg",
|
||||||
"valgrind",
|
"valgrind",
|
||||||
"cxxtest",
|
"cxxtest",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if not _OPTIONS["without-audio"] then
|
||||||
|
table.insert(extern_libs, "openal")
|
||||||
|
table.insert(extern_libs, "vorbis")
|
||||||
|
end
|
||||||
|
|
||||||
-- CPU architecture-specific
|
-- CPU architecture-specific
|
||||||
if arch == "amd64" then
|
if arch == "amd64" then
|
||||||
table.insert(source_dirs, "lib/sysdep/arch/amd64");
|
table.insert(source_dirs, "lib/sysdep/arch/amd64");
|
||||||
@ -624,7 +639,9 @@ function setup_all_libs ()
|
|||||||
end
|
end
|
||||||
|
|
||||||
if os.is("linux") then
|
if os.is("linux") then
|
||||||
if not _OPTIONS["android"] then
|
if _OPTIONS["android"] then
|
||||||
|
table.insert(source_dirs, "lib/sysdep/os/android")
|
||||||
|
else
|
||||||
table.insert(source_dirs, "lib/sysdep/os/unix/x")
|
table.insert(source_dirs, "lib/sysdep/os/unix/x")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -673,7 +690,6 @@ end
|
|||||||
used_extern_libs = {
|
used_extern_libs = {
|
||||||
"opengl",
|
"opengl",
|
||||||
"sdl",
|
"sdl",
|
||||||
"x11",
|
|
||||||
|
|
||||||
"libjpg",
|
"libjpg",
|
||||||
"libpng",
|
"libpng",
|
||||||
@ -682,9 +698,6 @@ used_extern_libs = {
|
|||||||
"spidermonkey",
|
"spidermonkey",
|
||||||
"libxml2",
|
"libxml2",
|
||||||
|
|
||||||
"openal",
|
|
||||||
"vorbis",
|
|
||||||
|
|
||||||
"boost",
|
"boost",
|
||||||
"cxxtest",
|
"cxxtest",
|
||||||
"comsuppw",
|
"comsuppw",
|
||||||
@ -692,10 +705,21 @@ used_extern_libs = {
|
|||||||
"libcurl",
|
"libcurl",
|
||||||
|
|
||||||
"valgrind",
|
"valgrind",
|
||||||
|
|
||||||
"nvtt",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if os.is("unix") and not _OPTIONS["android"] then
|
||||||
|
table.insert(used_extern_libs, "x11")
|
||||||
|
end
|
||||||
|
|
||||||
|
if not _OPTIONS["without-audio"] then
|
||||||
|
table.insert(used_extern_libs, "openal")
|
||||||
|
table.insert(used_extern_libs, "vorbis")
|
||||||
|
end
|
||||||
|
|
||||||
|
if not _OPTIONS["without-nvtt"] then
|
||||||
|
table.insert(used_extern_libs, "nvtt")
|
||||||
|
end
|
||||||
|
|
||||||
-- Bundles static libs together with main.cpp and builds game executable.
|
-- Bundles static libs together with main.cpp and builds game executable.
|
||||||
function setup_main_exe ()
|
function setup_main_exe ()
|
||||||
|
|
||||||
@ -736,12 +760,18 @@ function setup_main_exe ()
|
|||||||
|
|
||||||
elseif os.is("linux") or os.is("bsd") then
|
elseif os.is("linux") or os.is("bsd") then
|
||||||
|
|
||||||
-- Libraries
|
if not _OPTIONS["without-fam"] then
|
||||||
links {
|
links { "fam" }
|
||||||
"fam",
|
end
|
||||||
-- Utilities
|
|
||||||
"rt",
|
if not _OPTIONS["android"] then
|
||||||
}
|
links { "rt" }
|
||||||
|
end
|
||||||
|
|
||||||
|
if _OPTIONS["android"] then
|
||||||
|
-- NDK's STANDALONE-TOOLCHAIN.html says this is required
|
||||||
|
linkoptions { "-Wl,--fix-cortex-a8" }
|
||||||
|
end
|
||||||
|
|
||||||
if os.is("linux") then
|
if os.is("linux") then
|
||||||
links {
|
links {
|
||||||
@ -757,7 +787,9 @@ function setup_main_exe ()
|
|||||||
|
|
||||||
-- Threading support
|
-- Threading support
|
||||||
buildoptions { "-pthread" }
|
buildoptions { "-pthread" }
|
||||||
linkoptions { "-pthread" }
|
if not _OPTIONS["android"] then
|
||||||
|
linkoptions { "-pthread" }
|
||||||
|
end
|
||||||
|
|
||||||
-- For debug_resolve_symbol
|
-- For debug_resolve_symbol
|
||||||
configuration "Debug"
|
configuration "Debug"
|
||||||
|
Loading…
Reference in New Issue
Block a user