summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTriang3l <triang3l@yandex.ru>2020-11-21 17:14:40 +0300
committerTriang3l <triang3l@yandex.ru>2020-11-21 17:14:40 +0300
commit2f247e0f9e4433ec8a8b8d0ae6c97037803db620 (patch)
tree9cdbfb2b22ab29973a1bd4a3e03b5d1609559a5b
parent7cb3cc35640189f81d364e83db9196f6410fbb15 (diff)
[Build] Make premake-androidmk generate something
-rw-r--r--.gitmodules3
-rw-r--r--premake5.lua55
-rw-r--r--third_party/cpptoml.lua7
-rw-r--r--third_party/cxxopts.lua7
m---------third_party/premake-androidmk0
5 files changed, 53 insertions, 19 deletions
diff --git a/.gitmodules b/.gitmodules
index c8b4ef272..82de820d2 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -67,3 +67,6 @@
[submodule "third_party/premake-cmake"]
path = third_party/premake-cmake
url = https://github.com/Enhex/premake-cmake.git
+[submodule "third_party/premake-androidmk"]
+ path = third_party/premake-androidmk
+ url = https://github.com/Meoo/premake-androidmk.git
diff --git a/premake5.lua b/premake5.lua
index ac921ff61..7b8083a7e 100644
--- a/premake5.lua
+++ b/premake5.lua
@@ -1,6 +1,9 @@
include("tools/build")
require("third_party/premake-export-compile-commands/export-compile-commands")
require("third_party/premake-cmake/cmake")
+-- gmake required for androidmk.
+require("gmake")
+require("third_party/premake-androidmk/androidmk")
location(build_root)
targetdir(build_bin)
@@ -194,18 +197,23 @@ end
solution("xenia")
uuid("931ef4b0-6170-4f7a-aaf2-0fece7632747")
startproject("xenia-app")
- architecture("x86_64")
- if os.istarget("linux") then
- platforms({"Linux"})
- elseif os.istarget("windows") then
- platforms({"Windows"})
- -- 10.0.15063.0: ID3D12GraphicsCommandList1::SetSamplePositions.
- -- 10.0.19041.0: D3D12_HEAP_FLAG_CREATE_NOT_ZEROED.
- filter("action:vs2017")
- systemversion("10.0.19041.0")
- filter("action:vs2019")
- systemversion("10.0")
- filter({})
+ if os.istarget("android") then
+ architecture("ARM64")
+ platforms({"Android"})
+ else
+ architecture("x86_64")
+ if os.istarget("linux") then
+ platforms({"Linux"})
+ elseif os.istarget("windows") then
+ platforms({"Windows"})
+ -- 10.0.15063.0: ID3D12GraphicsCommandList1::SetSamplePositions.
+ -- 10.0.19041.0: D3D12_HEAP_FLAG_CREATE_NOT_ZEROED.
+ filter("action:vs2017")
+ systemversion("10.0.19041.0")
+ filter("action:vs2019")
+ systemversion("10.0")
+ filter({})
+ end
end
configurations({"Checked", "Debug", "Release"})
@@ -220,18 +228,15 @@ solution("xenia")
include("third_party/imgui.lua")
include("third_party/libav.lua")
include("third_party/mspack.lua")
- include("third_party/SDL2.lua")
include("third_party/snappy.lua")
include("third_party/spirv-tools.lua")
include("third_party/volk.lua")
include("third_party/xxhash.lua")
include("src/xenia")
- include("src/xenia/app")
include("src/xenia/app/discord")
include("src/xenia/apu")
include("src/xenia/apu/nop")
- include("src/xenia/apu/sdl")
include("src/xenia/base")
include("src/xenia/cpu")
include("src/xenia/cpu/backend/x64")
@@ -239,16 +244,32 @@ solution("xenia")
include("src/xenia/gpu")
include("src/xenia/gpu/null")
include("src/xenia/gpu/vulkan")
- include("src/xenia/helper/sdl")
include("src/xenia/hid")
include("src/xenia/hid/nop")
- include("src/xenia/hid/sdl")
include("src/xenia/kernel")
include("src/xenia/ui")
include("src/xenia/ui/spirv")
include("src/xenia/ui/vulkan")
include("src/xenia/vfs")
+ if not os.istarget("android") then
+ -- SDL2 requires sdl2-config, and as of November 2020 isn't high-quality on
+ -- Android yet, most importantly in game controllers - the keycode and axis
+ -- enums are being ruined during conversion to SDL2 enums resulting in only
+ -- one controller (Nvidia Shield) being supported, digital triggers are also
+ -- not supported; lifecycle management (especially surface loss) is also
+ -- complicated.
+ include("third_party/SDL2.lua")
+
+ include("src/xenia/apu/sdl")
+ include("src/xenia/helper/sdl")
+ include("src/xenia/hid/sdl")
+
+ -- TODO(Triang3l): src/xenia/app has a dependency on xenia-helper-sdl, bring
+ -- it back later.
+ include("src/xenia/app")
+ end
+
if os.istarget("windows") then
include("src/xenia/apu/xaudio2")
include("src/xenia/gpu/d3d12")
diff --git a/third_party/cpptoml.lua b/third_party/cpptoml.lua
index fa6c59059..5e7d6d74a 100644
--- a/third_party/cpptoml.lua
+++ b/third_party/cpptoml.lua
@@ -1,7 +1,12 @@
group("third_party")
project("cpptoml")
uuid("1e86cc51-3f8b-476d-9249-3b200424846b")
- kind("Utility")
+ if os.istarget("android") then
+ -- ndk-build only supports StaticLib and SharedLib.
+ kind("StaticLib")
+ else
+ kind("Utility")
+ end
language("C++")
files({
"cpptoml/include/cpptoml.h",
diff --git a/third_party/cxxopts.lua b/third_party/cxxopts.lua
index d3b3015ce..a54899457 100644
--- a/third_party/cxxopts.lua
+++ b/third_party/cxxopts.lua
@@ -1,7 +1,12 @@
group("third_party")
project("cxxopts")
uuid("8b68cbe8-2da4-4f28-be14-9352eafa3168")
- kind("Utility")
+ if os.istarget("android") then
+ -- ndk-build only supports StaticLib and SharedLib.
+ kind("StaticLib")
+ else
+ kind("Utility")
+ end
language("C++")
files({
"cxxopts/include/cxxopts.hpp",
diff --git a/third_party/premake-androidmk b/third_party/premake-androidmk
new file mode 160000
+Subproject a9f1733a70e71c1fc27a93e4153ac5e077d20c0