[Infra:Bugfix] Isolate NeuroPilot directory from GitHub sync#4619
Merged
Conversation
Discussed-in: Merge-Request 28555540 , URL: https://code.alibaba-inc.com/AliNN/AliNNPrivate/codereview/28555540 GitOrigin-RevId: de82056cbbfed0f160a93823874bda2d7ede248a
| ENDIF() | ||
| ENDIF() | ||
|
|
||
| # Vulkan |
There was a problem hiding this comment.
增加 IF(TARGET MNN_NEUROPILOT) 的防御性检查是一个很好的改进,能够有效避免因 add_subdirectory 在特定平台或缺少依赖时未成功创建目标而引发的构建错误,提升了跨平台兼容性。
不过,在错误处理和优雅降级方面还有改进空间:如果用户显式开启了 MNN_NEUROPILOT,但目标由于环境原因未能生成,当前代码会静默跳过。这可能导致用户误以为 Neuropilot 后端已经成功编译并可用。建议在未找到目标时输出警告信息,例如:
IF(MNN_NEUROPILOT)
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/source/backend/neuropilot)
IF(TARGET MNN_NEUROPILOT)
target_compile_options(MNNCore PRIVATE -DMNN_NEUROPILOT=1)
list(APPEND MNN_OBJECTS_TO_LINK $<TARGET_OBJECTS:MNN_NEUROPILOT>)
ELSE()
MESSAGE(WARNING "MNN_NEUROPILOT is enabled, but the MNN_NEUROPILOT target was not generated. The Neuropilot backend will be skipped.")
ENDIF()
ENDIF()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Discussed-in: Merge-Request 28555540 , URL: https://code.alibaba-inc.com/AliNN/AliNNPrivate/codereview/28555540
GitOrigin-RevId: de82056cbbfed0f160a93823874bda2d7ede248a
Description
Module
Type
Checklist
[Module:Type] Descriptionformat