Skip to content

Commit 4ec54c8

Browse files
libprotobuf and abseil_dll libs are missing on windows, fix it (#35)
1 parent 71cac63 commit 4ec54c8

File tree

1 file changed

+34
-5
lines changed

1 file changed

+34
-5
lines changed

CMakeLists.txt

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -559,28 +559,57 @@ install(TARGETS livekit
559559
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} # .a/.lib
560560
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
561561
)
562+
# Runtime artifacts (DLL / .so / .dylib) for imported shared libs.
563+
# On Unix, the shared library is also the link-time artifact, so this is enough.
562564
install(IMPORTED_RUNTIME_ARTIFACTS livekit_ffi
563565
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
564566
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
565567
)
566-
# We bundle the libprotobuf and abseil as part of our libs.
568+
# Windows needs the import libraries (.dll.lib/.lib) for link-time.
569+
# Note: we build either Debug OR Release per build (./build.sh debug or ./build.sh release),
570+
# so we only install the corresponding configuration’s import libs.
567571
if(WIN32)
572+
if(TARGET livekit_ffi)
573+
install(FILES
574+
$<IF:$<CONFIG:Debug>,
575+
$<TARGET_PROPERTY:livekit_ffi,IMPORTED_IMPLIB_DEBUG>,
576+
$<TARGET_PROPERTY:livekit_ffi,IMPORTED_IMPLIB_RELEASE>
577+
>
578+
DESTINATION ${CMAKE_INSTALL_LIBDIR}
579+
)
580+
endif()
581+
582+
# We bundle libprotobuf and abseil as part of our SDK.
568583
if(TARGET protobuf::libprotobuf)
569-
install(IMPORTED_RUNTIME_ARTIFACTS
570-
protobuf::libprotobuf
584+
install(IMPORTED_RUNTIME_ARTIFACTS protobuf::libprotobuf
571585
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
572586
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
573587
)
588+
install(FILES
589+
$<IF:$<CONFIG:Debug>,
590+
$<TARGET_PROPERTY:protobuf::libprotobuf,IMPORTED_IMPLIB_DEBUG>,
591+
$<TARGET_PROPERTY:protobuf::libprotobuf,IMPORTED_IMPLIB_RELEASE>
592+
>
593+
DESTINATION ${CMAKE_INSTALL_LIBDIR}
594+
)
574595
endif()
596+
575597
if(TARGET absl::abseil_dll)
576-
install(IMPORTED_RUNTIME_ARTIFACTS
577-
absl::abseil_dll
598+
install(IMPORTED_RUNTIME_ARTIFACTS absl::abseil_dll
578599
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
579600
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
580601
)
602+
install(FILES
603+
$<IF:$<CONFIG:Debug>,
604+
$<TARGET_PROPERTY:absl::abseil_dll,IMPORTED_IMPLIB_DEBUG>,
605+
$<TARGET_PROPERTY:absl::abseil_dll,IMPORTED_IMPLIB_RELEASE>
606+
>
607+
DESTINATION ${CMAKE_INSTALL_LIBDIR}
608+
)
581609
endif()
582610
endif()
583611

612+
584613
# Install public headers
585614
install(DIRECTORY "${CMAKE_SOURCE_DIR}/include/"
586615
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"

0 commit comments

Comments
 (0)