xmake-io / xmake

🔥 A cross-platform build utility based on Lua
https://xmake.io
Apache License 2.0
9.57k stars 762 forks source link

Build SDL 2 for mobile! #176

Closed hamad-almamari closed 5 years ago

hamad-almamari commented 6 years ago

Hello I just like how this project is easy . But can any one provide an example to build SDL 2 for mobile targets.

I can not find any info at the web site.

Also how we can sp app icon and android promises (The manifest file )

In direct simple Q . Can I use xmake to build c mobile apps/games

waruqi commented 6 years ago

Do you want to build the libsdl source code, or compile the project using the libsdl?

If you just want to compile the project using the libsdl, you can add add_links("sdl") in the xmake.lua file.

target("test")
    set_kind("binary")
    add_files("src/*.c")
    add_links("sdl")
    add_linkdirs("xxx")
hamad-almamari commented 6 years ago

What about app icon ? and android promises?

waruqi commented 6 years ago

xmake is currently used primarily for building native programs, .e.g c/c++/objc/android jni libs Java is not supported now, so you need call third-party the build tools(gradle/ant) to make app package.

for example:

target("test")
    set_kind("shared")
    add_files("app/jni/*.c")
    set_targetdir("app/libs/armeabi")
    after_build(function (target)
        os.exec("gradle :app:assembleDebug")
    end)