diff --git a/CMakeLists.txt b/CMakeLists.txt index 2d40b1951..f0d33c3db 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,6 +41,10 @@ get_filename_component(CC_BASENAME ${CMAKE_C_COMPILER} NAME) if (CMAKE_C_COMPILER_TARGET STREQUAL "arm-webos-linux-gnueabi") set(TARGET_WEBOS ON) + set(TARGET_WEBOS_ARCH "arm") +elseif(CMAKE_C_COMPILER_TARGET MATCHES "(i[3-6]86)-webos-linux-gnu") + set(TARGET_WEBOS ON) + set(TARGET_WEBOS_ARCH ${CMAKE_MATCH_1}) elseif (CMAKE_C_COMPILER_TARGET STREQUAL "armv7a-cros-linux-gnueabi") set(TARGET_STEAMLINK ON) endif () @@ -128,6 +132,7 @@ set(BUILD_SHARED_CORE_LIBS OFF) if (TARGET_WEBOS) set(CMAKE_INSTALL_LIBDIR lib/backports) + set(SDL2_BACKPORT_REVISION "2876d3b86c2e3c5700003dfbf3a978be17cea078") include(ExternalSDL2BackportForWebOS) unset(CMAKE_INSTALL_LIBDIR) else () diff --git a/cmake/AresPackage.cmake b/cmake/AresPackage.cmake index 0338b96df..7dee5d494 100644 --- a/cmake/AresPackage.cmake +++ b/cmake/AresPackage.cmake @@ -4,6 +4,7 @@ execute_process(COMMAND ares-package "${CPACK_TEMPORARY_DIRECTORY}" -o "${CPACK_ -e "libmbedtls[.].*" -e "lib/static" -e "lib/pkgconfig" + --force-arch "${CPACK_WEBOS_PACKAGE_ARCH}" COMMAND_ERROR_IS_FATAL ANY ) diff --git a/cmake/CPackConfig.webOS.cmake.in b/cmake/CPackConfig.webOS.cmake.in index 2ecd62a53..0653f2db3 100644 --- a/cmake/CPackConfig.webOS.cmake.in +++ b/cmake/CPackConfig.webOS.cmake.in @@ -1 +1,2 @@ -set(CPACK_WEBOS_STRIP_COMMAND "@CMAKE_STRIP@") \ No newline at end of file +set(CPACK_WEBOS_STRIP_COMMAND "@CMAKE_STRIP@") +set(CPACK_WEBOS_PACKAGE_ARCH "@TARGET_WEBOS_ARCH@") \ No newline at end of file diff --git a/cmake/PackageWebOS.cmake b/cmake/PackageWebOS.cmake index d3f418bda..acb144838 100644 --- a/cmake/PackageWebOS.cmake +++ b/cmake/PackageWebOS.cmake @@ -33,7 +33,7 @@ set(CPACK_EXTERNAL_PACKAGE_SCRIPT "${CMAKE_SOURCE_DIR}/cmake/AresPackage.cmake") set(CPACK_EXTERNAL_ENABLE_STAGING TRUE) set(CPACK_MONOLITHIC_INSTALL TRUE) set(CPACK_PACKAGE_DIRECTORY ${CMAKE_SOURCE_DIR}/dist) -set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${PROJECT_VERSION}_arm") +set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${PROJECT_VERSION}_${TARGET_WEBOS_ARCH}") set(CPACK_PRE_BUILD_SCRIPTS "${CMAKE_SOURCE_DIR}/cmake/CleanupNameLink.cmake") configure_file("${CMAKE_SOURCE_DIR}/cmake/CPackConfig.webOS.cmake.in" CPackConfig.webOS.cmake @ONLY) diff --git a/core/moonlight-common-c b/core/moonlight-common-c index 2bb026c76..c1744de06 160000 --- a/core/moonlight-common-c +++ b/core/moonlight-common-c @@ -1 +1 @@ -Subproject commit 2bb026c763fc18807d7e4a93f918054c488f84e1 +Subproject commit c1744de06938b5a5c8897a705be1bc6508dc7580 diff --git a/scripts/webos/easy_build.sh b/scripts/webos/easy_build.sh index 06a0d16f1..c94cf4fb7 100755 --- a/scripts/webos/easy_build.sh +++ b/scripts/webos/easy_build.sh @@ -23,9 +23,8 @@ if [ -z "$CI" ]; then fi if [ -z "${TOOLCHAIN_FILE}" ]; then - echo "Setup environment" - . /opt/webos-sdk-x86_64/1.0.g/environment-setup-armv7a-neon-webos-linux-gnueabi - TOOLCHAIN_FILE=/opt/webos-sdk-x86_64/1.0.g/sysroots/x86_64-webossdk-linux/usr/share/cmake/OEToolchainConfig.cmake + echo "Use buildroot-nc4 toolchain installed in /opt" + TOOLCHAIN_FILE=/opt/arm-webos-linux-gnueabi_sdk-buildroot/share/buildroot/toolchainfile.cmake fi echo "Configure project" diff --git a/src/app/app.c b/src/app/app.c index 6a447799e..24606aec9 100644 --- a/src/app/app.c +++ b/src/app/app.c @@ -65,7 +65,10 @@ int app_init(app_t *app, app_settings_loader *settings_loader, int argc, char *a SDL_SetHint(SDL_HINT_WEBOS_CURSOR_CALIBRATION_DISABLE, "true"); #endif // DO not init video subsystem before NDL/LGNC initialization - SDL_InitSubSystem(SDL_INIT_VIDEO); + if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0) { + commons_log_fatal("APP", "Failed to initialize SDL video subsystem: %s", SDL_GetError()); + return -1; + } // This will occupy SDL_USEREVENT SDL_RegisterEvents(1); commons_log_info("APP", "UI locale: %s (%s)", i18n_locale(), locstr("[Localized Language]")); diff --git a/src/app/input/app_input.c b/src/app/input/app_input.c index cb17ba15c..bbdbae6f8 100644 --- a/src/app/input/app_input.c +++ b/src/app/input/app_input.c @@ -26,7 +26,9 @@ void app_input_init(app_input_t *input, app_t *app) { void app_input_deinit(app_input_t *input) { app_input_deinit_gamepad_mapping(input); - SDL_FreeCursor(input->blank_cursor_surface->userdata); + if (input->blank_cursor_surface->userdata != NULL) { + SDL_FreeCursor(input->blank_cursor_surface->userdata); + } SDL_FreeSurface(input->blank_cursor_surface); SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER | SDL_INIT_HAPTIC); } diff --git a/third_party/commons b/third_party/commons index ed8add026..e3a5edfa2 160000 --- a/third_party/commons +++ b/third_party/commons @@ -1 +1 @@ -Subproject commit ed8add026b56187cca29b5867e5307717926d09d +Subproject commit e3a5edfa254fe1718817ef1c0b67319a795b2f90