Skip to content

Commit

Permalink
Exclude JAX FE from all distributions except wheel
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-lavrenov committed Sep 16, 2024
1 parent cd64efe commit 86c303e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
27 changes: 19 additions & 8 deletions cmake/developer_package/frontends/frontends.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,14 @@ endmacro()
# FILEDESCRIPTION <description> # used on Windows to describe DLL file
# [LINKABLE_FRONTEND] # whether we can use FE API directly or via FEM only
# [SKIP_INSTALL] # private frontend, not for end users
# [EXCLUDE_FROM_ALL] # excludes frontend from all cmake rules
# [PROTOBUF_REQUIRED] # options to denote that protobuf is used
# [PROTOBUF_LITE] # requires only libprotobuf-lite
# [SKIP_NCC_STYLE] # use custom NCC rules
# [LINK_LIBRARIES <lib1 lib2 ...>])
#
macro(ov_add_frontend)
set(options LINKABLE_FRONTEND PROTOBUF_REQUIRED PROTOBUF_LITE SKIP_NCC_STYLE SKIP_INSTALL)
set(options LINKABLE_FRONTEND PROTOBUF_REQUIRED PROTOBUF_LITE SKIP_NCC_STYLE SKIP_INSTALL EXCLUDE_FROM_ALL)
set(oneValueArgs NAME FILEDESCRIPTION)
set(multiValueArgs LINK_LIBRARIES PROTO_FILES)
cmake_parse_arguments(OV_FRONTEND "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
Expand Down Expand Up @@ -306,27 +307,37 @@ macro(ov_add_frontend)
# installation

if(NOT OV_FRONTEND_SKIP_INSTALL)
# convert option (OFF / ON) to actual value
if(OV_FRONTEND_EXCLUDE_FROM_ALL)
set(OV_FRONTEND_EXCLUDE_FROM_ALL EXCLUDE_FROM_ALL)
set(core_dev_exclude_from_all ${OV_FRONTEND_EXCLUDE_FROM_ALL})
set(comp_links_exclude_from_all ${OV_FRONTEND_EXCLUDE_FROM_ALL})
else()
unset(OV_FRONTEND_EXCLUDE_FROM_ALL)
set(core_dev_exclude_from_all ${OV_CPACK_COMP_CORE_DEV_EXCLUDE_ALL})
set(comp_links_exclude_from_all ${OV_CPACK_COMP_LINKS_EXCLUDE_ALL})
endif()

if(BUILD_SHARED_LIBS)
# Note:
# we use 'framework' as component for deployment scenario, i.e. for libraries itself
# and use common 'core_dev' component for headers, cmake files and symlinks to versioned library
set(lib_component "${OV_FRONTEND_NAME}")
set(dev_component "${OV_CPACK_COMP_CORE_DEV}")

# TODO: whether we need to do it configuralbe on Windows installer?
ov_cpack_add_component(${lib_component} HIDDEN)

if(OV_FRONTEND_LINKABLE_FRONTEND)
set(export_set EXPORT OpenVINOTargets)
set(archive_dest ARCHIVE DESTINATION ${OV_CPACK_ARCHIVEDIR} COMPONENT ${dev_component} ${OV_CPACK_COMP_CORE_DEV_EXCLUDE_ALL})
set(namelink NAMELINK_COMPONENT ${OV_CPACK_COMP_LINKS} ${OV_CPACK_COMP_LINKS_EXCLUDE_ALL})
set(archive_dest ARCHIVE DESTINATION ${OV_CPACK_ARCHIVEDIR} COMPONENT ${dev_component} ${core_dev_exclude_from_all})
set(namelink NAMELINK_COMPONENT ${OV_CPACK_COMP_LINKS} ${comp_links_exclude_from_all})
else()
set(namelink NAMELINK_SKIP)
endif()
install(TARGETS ${TARGET_NAME} ${export_set}
RUNTIME DESTINATION ${OV_CPACK_RUNTIMEDIR} COMPONENT ${lib_component}
${archive_dest}
LIBRARY DESTINATION ${OV_CPACK_LIBRARYDIR} COMPONENT ${lib_component}
RUNTIME DESTINATION ${OV_CPACK_RUNTIMEDIR} COMPONENT ${lib_component} ${OV_FRONTEND_EXCLUDE_FROM_ALL}
${archive_dest} ${OV_FRONTEND_EXCLUDE_FROM_ALL}
LIBRARY DESTINATION ${OV_CPACK_LIBRARYDIR} COMPONENT ${lib_component} ${OV_FRONTEND_EXCLUDE_FROM_ALL}
${namelink})

# export to build tree
Expand All @@ -343,7 +354,7 @@ macro(ov_add_frontend)
install(DIRECTORY ${${TARGET_NAME}_INCLUDE_DIR}/openvino
DESTINATION ${FRONTEND_INSTALL_INCLUDE}
COMPONENT ${dev_component}
${OV_CPACK_COMP_CORE_DEV_EXCLUDE_ALL}
${core_dev_exclude_from_all}
FILES_MATCHING PATTERN "*.hpp")

# public target name
Expand Down
1 change: 1 addition & 0 deletions src/frontends/jax/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ endif()

ov_add_frontend(NAME jax
LINKABLE_FRONTEND
EXCLUDE_FROM_ALL
FILEDESCRIPTION "FrontEnd to load and convert JAX/Flax models"
LINK_LIBRARIES openvino::util openvino::core::dev)

0 comments on commit 86c303e

Please sign in to comment.