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.5 kB

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