From dd06ca45a71fbc3830154ca1a7d1a1ff81727a1d Mon Sep 17 00:00:00 2001 From: lichaofan Date: Wed, 18 Dec 2024 15:35:12 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E3=80=90ARM64=E3=80=91=E3=80=90LOONG64?= =?UTF-8?q?=E3=80=91if=20not=20AMD64=20platform,=20do=20not=20show=20ai=20?= =?UTF-8?q?search=20config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Description: 【ARM64】【LOONG64】if not AMD64 platform, do not show ai search config Log: Bug: BUG-295519 --- src/grand-search/CMakeLists.txt | 11 +++++++++++ src/grand-search/gui/searchconfig/indexwidget.cpp | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/src/grand-search/CMakeLists.txt b/src/grand-search/CMakeLists.txt index b07fe650..ba0fdcf1 100644 --- a/src/grand-search/CMakeLists.txt +++ b/src/grand-search/CMakeLists.txt @@ -13,6 +13,17 @@ set(BIN_NAME ${SEARCH_BIN_NAME}) # 集成测试标签 ADD_DEFINITIONS(-DENABLE_ACCESSIBILITY) +if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "mips" + OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64" + OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "sw" + OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "loongarch64" + ) + message(${CMAKE_SYSTEM_PROCESSOR} ": disable ai search") +else() + message(${CMAKE_SYSTEM_PROCESSOR} ": enable ai search") + ADD_DEFINITIONS(-DENABLE_AI_SEARCH) +endif() + # 依赖包 find_package(PkgConfig REQUIRED) find_package(DtkWidget REQUIRED) diff --git a/src/grand-search/gui/searchconfig/indexwidget.cpp b/src/grand-search/gui/searchconfig/indexwidget.cpp index 0a6cb22f..a363818b 100644 --- a/src/grand-search/gui/searchconfig/indexwidget.cpp +++ b/src/grand-search/gui/searchconfig/indexwidget.cpp @@ -30,6 +30,11 @@ IndexWidget::IndexWidget(QWidget *parent) m_mainLayout->addWidget(m_intelligent); m_mainLayout->addSpacing(10); m_mainLayout->addWidget(m_blackListWidget); + +#ifndef ENABLE_AI_SEARCH + // 目前非amd64架构,用不了AI搜索 + m_intelligent->setVisible(false); +#endif } bool IndexWidget::onCloseEvent()