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

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 (TARGETS lite_c_examples
  19. EXPORT ${LITE_EXPORT_TARGETS}
  20. RUNTIME DESTINATION lite/bin)
  21. # add lite_examples_depends_shared for CI check symbol export valid
  22. add_executable(lite_c_examples_depends_shared ./main.c)
  23. if(LITE_BUILD_WITH_RKNPU)
  24. #rknn sdk1.0.0 depend on libc++_shared, use gold to remove NEEDED so symbol check
  25. target_link_options(lite_c_examples_depends_shared PRIVATE "-fuse-ld=gold")
  26. endif()
  27. target_link_libraries(lite_c_examples_depends_shared lite_shared)
  28. if(UNIX)
  29. if(APPLE OR ANDROID)
  30. target_link_libraries(lite_c_examples_depends_shared dl)
  31. else()
  32. target_link_libraries(lite_c_examples_depends_shared dl rt)
  33. endif()
  34. endif()
  35. install (TARGETS lite_c_examples_depends_shared
  36. EXPORT ${LITE_EXPORT_TARGETS}
  37. RUNTIME DESTINATION lite/bin)