You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

CMakeLists.txt 1.4 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. add_executable(lite_c_examples ./main.c)
  2. if(LITE_BUILD_WITH_RKNPU)
  3. # rknn sdk1.0.0 depend on libc++_shared, use gold to remove NEEDED so symbol check
  4. target_link_options(lite_c_examples PRIVATE "-fuse-ld=gold")
  5. endif()
  6. target_link_libraries(lite_c_examples lite_static)
  7. if(LITE_BUILD_WITH_MGE AND MGE_WITH_ROCM)
  8. # FIXME: hip obj can not find cpp obj only through lite_static
  9. target_link_libraries(lite_c_examples megdnn)
  10. endif()
  11. if(UNIX)
  12. if(APPLE OR ANDROID)
  13. target_link_libraries(lite_c_examples dl)
  14. else()
  15. target_link_libraries(lite_c_examples dl rt)
  16. endif()
  17. endif()
  18. install(
  19. TARGETS lite_c_examples
  20. EXPORT ${LITE_EXPORT_TARGETS}
  21. RUNTIME DESTINATION lite/bin)
  22. # add lite_examples_depends_shared for CI check symbol export valid
  23. add_executable(lite_c_examples_depends_shared ./main.c)
  24. if(LITE_BUILD_WITH_RKNPU)
  25. # rknn sdk1.0.0 depend on libc++_shared, use gold to remove NEEDED so symbol check
  26. target_link_options(lite_c_examples_depends_shared PRIVATE "-fuse-ld=gold")
  27. endif()
  28. target_link_libraries(lite_c_examples_depends_shared lite_shared)
  29. if(UNIX)
  30. if(APPLE OR ANDROID)
  31. target_link_libraries(lite_c_examples_depends_shared dl)
  32. else()
  33. target_link_libraries(lite_c_examples_depends_shared dl rt)
  34. endif()
  35. endif()
  36. install(
  37. TARGETS lite_c_examples_depends_shared
  38. EXPORT ${LITE_EXPORT_TARGETS}
  39. RUNTIME DESTINATION lite/bin)