Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 【ARM64】【LOONG64】if not AMD64 platform, do not show ai search config #162

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/grand-search/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 10 additions & 1 deletion src/grand-search/gui/searchconfig/indexwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,25 @@ IndexWidget::IndexWidget(QWidget *parent)
m_groupLabel = new QLabel(tr("Index"));
DFontSizeManager::instance()->bind(m_groupLabel, DFontSizeManager::T5, QFont::Bold);

m_intelligent = new IntelligentRetrievalWidget(this);
m_mainLayout->addWidget(m_groupLabel);

#ifdef ENABLE_AI_SEARCH
// 目前非amd64架构,用不了AI搜索
m_intelligent = new IntelligentRetrievalWidget(this);
m_mainLayout->addWidget(m_intelligent);
#endif

m_mainLayout->addSpacing(10);
m_mainLayout->addWidget(m_blackListWidget);
}

bool IndexWidget::onCloseEvent()
{
#ifdef ENABLE_AI_SEARCH
return m_intelligent->onCloseEvent();
#else
return true;
#endif
}

IndexWidget::~IndexWidget()
Expand Down
Loading