File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66
77// Version injected by CMake (CI should set it). Defaults to 0.0.0 for dev builds.
88#define LIVEKIT_BUILD_VERSION "@LIVEKIT_VERSION@"
9- #define LIVEKIT_BUILD_FLAVOR "cpp"
10- #define LIVEKIT_CAPTURE_ENABLED @LIVEKIT_CAPTURE_ENABLED@
9+ #define LIVEKIT_BUILD_FLAVOR "cpp"
10+
11+ namespace livekit {
12+
13+ /// @brief Whether the Rust FFI was built with capture-source support.
14+ inline constexpr bool kCaptureEnabled = "@LIVEKIT_CAPTURE_ENABLED@" [0 ] == '1' ;
15+
16+ } // namespace livekit
1117
1218#ifdef DEBUG
13- #define LIVEKIT_BUILD_SUFFIX "-debug"
19+ #define LIVEKIT_BUILD_SUFFIX "-debug"
1420#else
15- #define LIVEKIT_BUILD_SUFFIX "-release"
21+ #define LIVEKIT_BUILD_SUFFIX "-release"
1622#endif
1723
1824// Follow params are auto generated by CMakeLists.txt
19- #define LIVEKIT_BUILD_DATE "@BUILD_DATE@"
25+ #define LIVEKIT_BUILD_DATE "@BUILD_DATE@"
2026#define LIVEKIT_BUILD_COMMIT "@GIT_COMMIT@"
2127
2228#define LIVEKIT_BUILD_VERSION_FULL LIVEKIT_BUILD_VERSION LIVEKIT_BUILD_SUFFIX
Original file line number Diff line number Diff line change @@ -51,12 +51,12 @@ constexpr std::uint32_t kCaptureFramerateFps = 30;
5151// / Skips the calling test when the FFI library was built without the capture
5252// / feature. A feature-less FFI reports only a generic invalid handle, so this
5353// / has to be decided at compile time rather than sniffed from an error string.
54- #if LIVEKIT_CAPTURE_ENABLED
55- # define SKIP_WITHOUT_CAPTURE_FEATURE () (( void ) 0 )
56- # else
57- # define SKIP_WITHOUT_CAPTURE_FEATURE () \
58- GTEST_SKIP () << "livekit-ffi built without the 'capture' feature; configure with - DLIVEKIT_ENABLE_CAPTURE = ON "
59- #endif
54+ #define SKIP_WITHOUT_CAPTURE_FEATURE () \
55+ do { \
56+ if constexpr (! kCaptureEnabled ) { \
57+ GTEST_SKIP () << " livekit-ffi built without the 'capture' feature; configure with -DLIVEKIT_ENABLE_CAPTURE=ON " ; \
58+ } \
59+ } while ( false )
6060
6161std::shared_ptr<CaptureSource> createPatternCapture () {
6262 PatternVideoSourceConfig config;
You can’t perform that action at this time.
0 commit comments