diff options
author | 2023-02-26 19:40:37 +0100 | |
---|---|---|
committer | 2023-02-27 05:40:37 +1100 | |
commit | bd59a0d447b861982429905f186dee8b12f2e777 (patch) | |
tree | dc6341c8fb098818039127f758cf3eb0fade986a /scripts/src/osd/sdl.lua | |
parent | 28b03e92a84daf79eb3cef75c51c014b2f57807b (diff) |
Removed local copy of SDL source and update Android build support. (#10899)
* Removed SDL2 source.
* Updated gradle.
* Updated SDL2 Java support glue code.
* Increased minimum supported Android API version to 24.
* Updated required asset files for Android app.
* Added proper tag for Android logging.
* Added SDL2 hint to make BGFX work on Android.
Diffstat (limited to 'scripts/src/osd/sdl.lua')
-rw-r--r-- | scripts/src/osd/sdl.lua | 108 |
1 files changed, 28 insertions, 80 deletions
diff --git a/scripts/src/osd/sdl.lua b/scripts/src/osd/sdl.lua index 3aa046b8ab1..abf4a90fd97 100644 --- a/scripts/src/osd/sdl.lua +++ b/scripts/src/osd/sdl.lua @@ -54,14 +54,11 @@ function maintargetosdoptions(_target,_subtarget) end if _OPTIONS["targetos"]=="windows" then - if _OPTIONS["with-bundled-sdl2"]~=nil then + if _OPTIONS["USE_LIBSDL"]~="1" then configuration { "mingw*"} links { + "SDL2main", "SDL2", - "imm32", - "version", - "ole32", - "oleaut32", } configuration { "vs*" } links { @@ -71,34 +68,20 @@ function maintargetosdoptions(_target,_subtarget) } configuration { } else - if _OPTIONS["USE_LIBSDL"]~="1" then - configuration { "mingw*"} - links { - "SDL2main", - "SDL2", - } - configuration { "vs*" } - links { - "SDL2", - "imm32", - "version", - } - configuration { } - else - local str = backtick(sdlconfigcmd() .. " --libs | sed 's/ -lSDLmain//'") - addlibfromstring(str) - addoptionsfromstring(str) - end - configuration { "x32", "vs*" } - libdirs { - path.join(_OPTIONS["SDL_INSTALL_ROOT"],"lib","x86") - } - configuration { "x64", "vs*" } - libdirs { - path.join(_OPTIONS["SDL_INSTALL_ROOT"],"lib","x64") - } - configuration { } + local str = backtick(sdlconfigcmd() .. " --libs | sed 's/ -lSDLmain//'") + addlibfromstring(str) + addoptionsfromstring(str) end + configuration { "x32", "vs*" } + libdirs { + path.join(_OPTIONS["SDL_INSTALL_ROOT"],"lib","x86") + } + configuration { "x64", "vs*" } + libdirs { + path.join(_OPTIONS["SDL_INSTALL_ROOT"],"lib","x64") + } + configuration { } + links { "dinput8", "psapi", @@ -117,15 +100,6 @@ function maintargetosdoptions(_target,_subtarget) "ole32", } configuration { } - - if _OPTIONS["targetos"]=="macosx" then - if _OPTIONS["with-bundled-sdl2"]~=nil then - links { - "SDL2", - } - end - end - end @@ -160,7 +134,7 @@ newoption { } if not _OPTIONS["NO_X11"] then - if _OPTIONS["targetos"]=="windows" or _OPTIONS["targetos"]=="macosx" or _OPTIONS["targetos"]=="haiku" or _OPTIONS["targetos"]=="asmjs" then + if _OPTIONS["targetos"]=="windows" or _OPTIONS["targetos"]=="macosx" or _OPTIONS["targetos"]=="haiku" or _OPTIONS["targetos"]=="asmjs" or _OPTIONS["targetos"]=="android" then _OPTIONS["NO_X11"] = "1" else _OPTIONS["NO_X11"] = "0" @@ -177,7 +151,7 @@ newoption { } if not _OPTIONS["NO_USE_XINPUT"] then - if _OPTIONS["targetos"]=="windows" or _OPTIONS["targetos"]=="macosx" or _OPTIONS["targetos"]=="haiku" or _OPTIONS["targetos"]=="asmjs" then + if _OPTIONS["targetos"]=="windows" or _OPTIONS["targetos"]=="macosx" or _OPTIONS["targetos"]=="haiku" or _OPTIONS["targetos"]=="asmjs" or _OPTIONS["targetos"]=="android" then _OPTIONS["NO_USE_XINPUT"] = "1" else _OPTIONS["NO_USE_XINPUT"] = "0" @@ -252,11 +226,6 @@ elseif _OPTIONS["targetos"]=="macosx" then SDLOS_TARGETOS = "macosx" end -if _OPTIONS["with-bundled-sdl2"]~=nil then - includedirs { - GEN_DIR .. "includes", - } -end if BASE_TARGETOS=="unix" then if _OPTIONS["targetos"]=="macosx" then local os_version = str_to_version(backtick("sw_vers -productVersion")) @@ -276,29 +245,17 @@ if BASE_TARGETOS=="unix" then "-weak_framework Metal", } end - if _OPTIONS["with-bundled-sdl2"]~=nil then + if _OPTIONS["USE_LIBSDL"]~="1" then linkoptions { - "-framework AudioToolbox", - "-framework AudioUnit", - "-framework CoreAudio", - "-framework Carbon", - "-framework ForceFeedback", - "-framework IOKit", - "-framework CoreVideo", + "-F" .. _OPTIONS["SDL_FRAMEWORK_PATH"], + } + links { + "SDL2.framework", } else - if _OPTIONS["USE_LIBSDL"]~="1" then - linkoptions { - "-F" .. _OPTIONS["SDL_FRAMEWORK_PATH"], - } - links { - "SDL2.framework", - } - else - local str = backtick(sdlconfigcmd() .. " --libs --static | sed 's/-lSDLmain//'") - addlibfromstring(str) - addoptionsfromstring(str) - end + local str = backtick(sdlconfigcmd() .. " --libs --static | sed 's/-lSDLmain//'") + addlibfromstring(str) + addoptionsfromstring(str) end else if _OPTIONS["NO_X11"]=="1" then @@ -310,17 +267,9 @@ if BASE_TARGETOS=="unix" then "/usr/openwin/lib", } end - if _OPTIONS["with-bundled-sdl2"]~=nil then - if _OPTIONS["targetos"]~="android" then - links { - "SDL2", - } - end - else - local str = backtick(sdlconfigcmd() .. " --libs") - addlibfromstring(str) - addoptionsfromstring(str) - end + local str = backtick(sdlconfigcmd() .. " --libs") + addlibfromstring(str) + addoptionsfromstring(str) if _OPTIONS["targetos"]~="haiku" and _OPTIONS["targetos"]~="android" then links { @@ -441,7 +390,6 @@ project ("osd_" .. _OPTIONS["osd"]) MAME_DIR .. "src/osd/sdl/window.h", } - project ("ocore_" .. _OPTIONS["osd"]) targetsubdir(_OPTIONS["target"] .."_" .. _OPTIONS["subtarget"]) uuid (os.uuid("ocore_" .. _OPTIONS["osd"])) |