From c2b45fc31cbc29374e67acb7c66a7e5a00a3cf6c Mon Sep 17 00:00:00 2001 From: Eatgrapes Date: Sun, 21 Dec 2025 20:05:23 +0800 Subject: [PATCH 1/2] fix(cmake): correct ARM64 architecture detection on Linux --- .../Demo/proj.linux.cmake/CMakeLists.txt | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Samples/OpenGL/Demo/proj.linux.cmake/CMakeLists.txt b/Samples/OpenGL/Demo/proj.linux.cmake/CMakeLists.txt index 45c4b1ab..df343963 100644 --- a/Samples/OpenGL/Demo/proj.linux.cmake/CMakeLists.txt +++ b/Samples/OpenGL/Demo/proj.linux.cmake/CMakeLists.txt @@ -18,6 +18,29 @@ set(COMMON_SRC_PATH ${SDK_ROOT_PATH}/Samples/Common) # Set project. project(${APP_NAME}) +if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64" OR CMAKE_SYSTEM_PROCESSOR MATCHES "arm64") + set(CORE_LIB_DIR "experimental/linux/arm64") +elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") + set(CORE_LIB_DIR "linux/x86_64") +else() + find_program(UNAME_EXECUTABLE uname) + if(UNAME_EXECUTABLE) + execute_process(COMMAND ${UNAME_EXECUTABLE} -m + OUTPUT_VARIABLE ARCH + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + if(ARCH MATCHES "aarch64|arm64") + set(CORE_LIB_DIR "experimental/linux/arm64") + elseif(ARCH MATCHES "x86_64|amd64") + set(CORE_LIB_DIR "linux/x86_64") + else() + message(FATAL_ERROR "Unsupported architecture: ${ARCH}") + endif() + else() + message(FATAL_ERROR "Cannot detect system architecture") + endif() +endif() + # Define output directory. set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin/${APP_NAME}) # Set configuration (Release and Debug only). From 7a8d82772f6ac76867fc6e1f58955412af92985f Mon Sep 17 00:00:00 2001 From: Eatgrapes Date: Fri, 26 Dec 2025 17:02:32 +0800 Subject: [PATCH 2/2] Update CMakeLists.txt --- Samples/OpenGL/Demo/proj.linux.cmake/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Samples/OpenGL/Demo/proj.linux.cmake/CMakeLists.txt b/Samples/OpenGL/Demo/proj.linux.cmake/CMakeLists.txt index df343963..b26d673c 100644 --- a/Samples/OpenGL/Demo/proj.linux.cmake/CMakeLists.txt +++ b/Samples/OpenGL/Demo/proj.linux.cmake/CMakeLists.txt @@ -65,10 +65,13 @@ set(CMAKE_CXX_EXTENSIONS OFF) # Add Cubism Core. # Import as static library. add_library(Live2DCubismCore STATIC IMPORTED) + +set(CORE_LIB_PATH ${CORE_PATH}/lib/${CORE_LIB_DIR}/libLive2DCubismCore.a) + # Find library path. set_target_properties(Live2DCubismCore PROPERTIES - IMPORTED_LOCATION ${CORE_PATH}/lib/linux/x86_64/libLive2DCubismCore.a + IMPORTED_LOCATION ${CORE_LIB_PATH} INTERFACE_INCLUDE_DIRECTORIES ${CORE_PATH}/include )