From fd1e68d3b291fa3c894069826b38ac88b461bdfd Mon Sep 17 00:00:00 2001 From: Pierre Moulon Date: Fri, 13 Sep 2024 17:07:26 -0700 Subject: [PATCH] {Build} Enhance build stability Summary: - Better support recent fmt library update - `fmt::join` needs an include - Better support of CMake install - vrs_utils_cli needs to be installed - VrsPlayer is Thread dependent - need to be linked to Threads - Linux `rt` library is required - to fix `undefined reference to aio_write` & `undefined reference to aio_return` on some distributions - `lz4` and `zstd` does not need to leak to client (only used in cpp) - they can be linked privately Differential Revision: D62672156 --- tools/vrsplayer/CMakeLists.txt | 1 + tools/vrsplayer/FrameWidget.cpp | 2 ++ vrs/CMakeLists.txt | 5 +++++ vrs/utils/cli/CMakeLists.txt | 12 +++++++++++- 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/tools/vrsplayer/CMakeLists.txt b/tools/vrsplayer/CMakeLists.txt index 11d95560..3af76ab1 100644 --- a/tools/vrsplayer/CMakeLists.txt +++ b/tools/vrsplayer/CMakeLists.txt @@ -39,6 +39,7 @@ if (QT_FOUND) Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets vrs_logging + Threads::Threads ) install(TARGETS vrsplayer EXPORT VRSLibTargets diff --git a/tools/vrsplayer/FrameWidget.cpp b/tools/vrsplayer/FrameWidget.cpp index 92049d07..754d3b87 100644 --- a/tools/vrsplayer/FrameWidget.cpp +++ b/tools/vrsplayer/FrameWidget.cpp @@ -32,6 +32,8 @@ #include #endif +#include + #define DEFAULT_LOG_CHANNEL "FrameWidget" #include #include diff --git a/vrs/CMakeLists.txt b/vrs/CMakeLists.txt index 72d9ab04..8e072dad 100644 --- a/vrs/CMakeLists.txt +++ b/vrs/CMakeLists.txt @@ -30,10 +30,15 @@ target_link_libraries(vrslib vrs_logging vrs_os vrs_utils_xxhash +) +target_link_libraries(vrslib + PRIVATE Lz4::Lz4 Zstd::Zstd ) +target_link_libraries (vrslib PUBLIC $<$:rt>) + install(TARGETS vrslib EXPORT VRSLibTargets LIBRARY DESTINATION lib ARCHIVE DESTINATION lib diff --git a/vrs/utils/cli/CMakeLists.txt b/vrs/utils/cli/CMakeLists.txt index 071cf10d..d423727b 100644 --- a/vrs/utils/cli/CMakeLists.txt +++ b/vrs/utils/cli/CMakeLists.txt @@ -15,7 +15,11 @@ file (GLOB VRS_UTILS_CLI_SRCS *.cpp *.h *.hpp) add_library(vrs_utils_cli ${VRS_UTILS_CLI_SRCS}) -target_include_directories(vrs_utils_cli PUBLIC ${VRS_SOURCE_DIR}) +target_include_directories(vrs_utils_cli + PUBLIC + $ + $ +) target_link_libraries(vrs_utils_cli PUBLIC vrs_utils @@ -23,3 +27,9 @@ target_link_libraries(vrs_utils_cli vrs_helpers vrs_logging ) +install(TARGETS vrs_utils_cli EXPORT VRSLibTargets + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + RUNTIME DESTINATION bin + INCLUDES DESTINATION include +)