1 # CMake definitions for libupb.
3 include(${protobuf_SOURCE_DIR}/src/file_lists.cmake)
4 include(${protobuf_SOURCE_DIR}/cmake/protobuf-configure-target.cmake)
6 set(bootstrap_cmake_dir ${protobuf_SOURCE_DIR}/upb/reflection/cmake)
8 # Hardcode bootstrap paths
9 ${bootstrap_cmake_dir}/google/protobuf/descriptor.upb.h
10 ${bootstrap_cmake_dir}/google/protobuf/descriptor.upb_minitable.h
11 ${bootstrap_cmake_dir}/google/protobuf/descriptor.upb_minitable.c
14 # Note: upb does not support shared library builds, and is intended to be
15 # statically linked as a private dependency.
16 add_library(libupb STATIC
20 ${protobuf_version_rc_file}
23 target_include_directories(libupb PUBLIC
24 $<BUILD_INTERFACE:${bootstrap_cmake_dir}>
25 $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
28 protobuf_configure_target(libupb)
30 set_target_properties(libupb PROPERTIES
31 VERSION ${protobuf_VERSION}
32 OUTPUT_NAME ${LIB_PREFIX}upb
33 DEBUG_POSTFIX "${protobuf_DEBUG_POSTFIX}"
34 # For -fvisibility=hidden and -fvisibility-inlines-hidden
35 C_VISIBILITY_PRESET hidden
36 CXX_VISIBILITY_PRESET hidden
37 VISIBILITY_INLINES_HIDDEN ON
39 add_library(protobuf::libupb ALIAS libupb)
40 target_link_libraries(libupb PRIVATE utf8_range)