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

a minor issue in prebuild ncnn-android libs #5466

Open
zhouwg opened this issue May 20, 2024 · 0 comments
Open

a minor issue in prebuild ncnn-android libs #5466

zhouwg opened this issue May 20, 2024 · 0 comments

Comments

@zhouwg
Copy link

zhouwg commented May 20, 2024

detail | 详细描述 | 詳細な説明

  1. Description: there is a minor issue in prebuild ncnn-20240410-android-vulkan.zip which provided in this project。在其它需要用到C++ RTTI&exception的开源项目中混合使用本项目提供的预编译ncnn-20240410-android-vulkan.zip时,会出现编译问题。

  2. Why C++ RTTI & exception are prohibited/disabled in this project? 为啥这个项目默认禁止使用C++ RTTI & exception?

    pls refer to: Android下的build,为什么默认关闭exception呢? #5431

  3. Rootcause: C++ RTTI and exception are prohibited in some IT companies(Google, ...) according to "internal coding principle". but they are mightbe used in some widely-used open-source projects, so there might be conflict in some special scenarios.

  4. How to fix(用如下的workaround方法可以解决这个问题,或者干脆想办法在构建脚本/系统中将依赖于商业公司维护的开源项目的代码与依赖于个人维护的开源项目的代码分开编译):

--- a/core/ncnn/ncnn-20240410-android-vulkan/arm64-v8a/lib/cmake/ncnn/ncnn.cmake
+++ b/core/ncnn/ncnn-20240410-android-vulkan/arm64-v8a/lib/cmake/ncnn/ncnn.cmake
@@ -59,7 +59,7 @@ endif()
 add_library(ncnn STATIC IMPORTED)
 
 set_target_properties(ncnn PROPERTIES
-  INTERFACE_COMPILE_OPTIONS "-fno-rtti;-fno-exceptions"
+  #INTERFACE_COMPILE_OPTIONS "-fno-rtti;-fno-exceptions"
   INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/ncnn"
   INTERFACE_LINK_LIBRARIES "-fopenmp;-static-openmp;-Wl,-wrap,__kmp_affinity_determine_capable;Threads::Threads;\$<LINK_ONLY:dl>;\$<LINK_ONLY:glslang::glslang>;\$<LINK_ONLY:glslang::SPIRV>;android;jnigraphics;log"
   INTERFACE_POSITION_INDEPENDENT_CODE "ON"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant