提交 f7cf3e34 编写于 作者: M Megvii Engine Team

feat(lite): fix load_and_run_depend_shared on windows

GitOrigin-RevId: 344808a3ad67e759320ada92c2ebd49875122ba3
上级 f75261d7
...@@ -27,35 +27,33 @@ if(UNIX) ...@@ -27,35 +27,33 @@ if(UNIX)
endif() endif()
install (TARGETS load_and_run EXPORT ${LITE_EXPORT_TARGETS} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) install (TARGETS load_and_run EXPORT ${LITE_EXPORT_TARGETS} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
# FIXME: using shared lib to build load and run(lite shared lib is not work correctly ) if(BUILD_SHARED_LIBS)
# if(BUILD_SHARED_LIBS) add_executable(load_and_run_depends_shared ${SOURCES})
# add_executable(load_and_run_depends_shared ${SOURCES}) target_link_libraries(load_and_run_depends_shared lite_shared)
# target_link_libraries(load_and_run_depends_shared lite_shared) target_link_libraries(load_and_run_depends_shared gflags)
# target_link_libraries(load_and_run_depends_shared megengine) target_link_libraries(load_and_run_depends_shared megengine)
# target_link_libraries(load_and_run_depends_shared gflags)
if(WIN32 OR MSVC)
# if(WIN32 OR MSVC) target_compile_definitions(load_and_run_depends_shared PRIVATE MGE_DLL_IMPORT_DATA)
# target_compile_definitions(load_and_run_depends_shared PRIVATE MGE_DLL_IMPORT_DATA) endif()
# endif()
if(LITE_BUILD_WITH_RKNPU)
# if(LITE_BUILD_WITH_RKNPU) #rknn sdk1.0.0 depend on libc++_shared, use gold to remove NEEDED so symbol check
# #rknn sdk1.0.0 depend on libc++_shared, use gold to remove NEEDED so symbol check target_link_options(load_and_run_depends_shared PRIVATE "-fuse-ld=gold")
# target_link_options(load_and_run_depends_shared PRIVATE "-fuse-ld=gold") endif()
# endif()
if(MGE_WITH_ROCM)
# if(MGE_WITH_ROCM) # FIXME: hip obj can not find cpp obj only through lite_static
# # FIXME: hip obj can not find cpp obj only through lite_static target_link_libraries(load_and_run_depends_shared megdnn)
# target_link_libraries(load_and_run_depends_shared megdnn) endif()
# endif()
# if(UNIX)
# if(APPLE OR ANDROID)
# target_link_libraries(load_and_run_depends_shared dl)
# else()
# target_link_libraries(load_and_run_depends_shared dl rt)
# endif()
# endif()
# install(TARGETS load_and_run_depends_shared EXPORT ${MGE_EXPORT_TARGETS} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
# endif()
if(UNIX)
if(APPLE OR ANDROID)
target_link_libraries(load_and_run_depends_shared dl)
else()
target_link_libraries(load_and_run_depends_shared dl rt)
endif()
endif()
install(TARGETS load_and_run_depends_shared EXPORT ${MGE_EXPORT_TARGETS} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
...@@ -40,7 +40,8 @@ private: ...@@ -40,7 +40,8 @@ private:
}; };
#endif #endif
std::string ssprintf(const char* fmt = 0, ...) __attribute__((format(printf, 1, 2))); LITE_API std::string ssprintf(const char* fmt = 0, ...)
__attribute__((format(printf, 1, 2)));
/*! /*!
* \brief Print a message. * \brief Print a message.
...@@ -48,7 +49,7 @@ std::string ssprintf(const char* fmt = 0, ...) __attribute__((format(printf, 1, ...@@ -48,7 +49,7 @@ std::string ssprintf(const char* fmt = 0, ...) __attribute__((format(printf, 1,
* The message is printed only if level is above or equals to the current log * The message is printed only if level is above or equals to the current log
* level. * level.
*/ */
void print_log(LiteLogLevel level, const char* format = 0, ...) LITE_API void print_log(LiteLogLevel level, const char* format = 0, ...)
__attribute__((format(printf, 2, 3))); __attribute__((format(printf, 2, 3)));
} // namespace lite } // namespace lite
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册