From c7a175c3adeccba96621511cb5fbe0d48c02d259 Mon Sep 17 00:00:00 2001 From: Ningyuan Li Date: Mon, 26 Dec 2022 17:52:31 +0900 Subject: [PATCH] fixed build with new toolchain --- CMakeLists.txt | 6 +++--- cmake/PackageWebOS.cmake | 9 ++++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 04ed599..3636351 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,10 +21,10 @@ find_library(MBEDCRYPTO_LIBRARY mbedcrypto) option(IHSPLAY_WIP_FEATURES "Enable Work-in-Progress Features" OFF) set(IHSPLAY_FEATURE_RELMOUSE ON) -if ("$ENV{CROSS_COMPILE}" STREQUAL "arm-webos-linux-gnueabi-") +get_filename_component(CMAKE_C_COMPILER_NAME "${CMAKE_C_COMPILER}" NAME) + +if (CMAKE_C_COMPILER_NAME MATCHES "^arm-webos-linux-gnueabi-") set(TARGET_WEBOS TRUE) - # TODO: Remove usage of ENV{ARCH} - set(ENV{ARCH} "arm") endif () if (NOT PROTOBUF_C_LIBRARIES OR NOT PROTOBUF_C_INCLUDEDIR) diff --git a/cmake/PackageWebOS.cmake b/cmake/PackageWebOS.cmake index 32c4241..6b035f5 100644 --- a/cmake/PackageWebOS.cmake +++ b/cmake/PackageWebOS.cmake @@ -1,10 +1,17 @@ +get_filename_component(CMAKE_C_COMPILER_NAME "${CMAKE_C_COMPILER}" NAME) +if (CMAKE_C_COMPILER_NAME MATCHES "^arm-webos-linux-gnueabi-") + set(CPACK_PACKAGE_ARCHITECTURE "arm") +else() + message(FATAL_ERROR "Unknown build architecture inferred from C compiler ${CMAKE_C_COMPILER_NAME}") +endif () + set(CPACK_PACKAGE_NAME "org.mariotaku.ihsplay") set(CPACK_GENERATOR "External") 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}_$ENV{ARCH}") +set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${PROJECT_VERSION}_${CPACK_PACKAGE_ARCHITECTURE}") # Copy manifest configure_file(deploy/webos/appinfo.json.in ./appinfo.json @ONLY)