Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
cmake_minimum_required(VERSION 3.22)

project(simple-whep-client VERSION 1.0 LANGUAGES C)

find_package(PkgConfig REQUIRED)

pkg_check_modules(
GSTREAMER
REQUIRED
IMPORTED_TARGET
gstreamer-1.0>=1.16
gstreamer-webrtc-1.0>=1.16
gstreamer-sdp-1.0>=1.16
gstreamer-video-1.0
)

pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0)
pkg_check_modules(SOUP REQUIRED IMPORTED_TARGET libsoup-3.0)

add_executable(whep-client src/whep-client.c)

target_compile_features(whep-client PRIVATE c_std_99)
target_compile_options(
whep-client
PRIVATE
-Wall
-Wstrict-prototypes
-Wmissing-prototypes
-Wmissing-declarations
-Wunused
)

target_link_libraries(
whep-client
PRIVATE PkgConfig::GSTREAMER PkgConfig::GLIB PkgConfig::SOUP
)

if(WIN32)
target_compile_definitions(whep-client PRIVATE _WIN32_WINNT=0x0601)
target_link_libraries(whep-client PRIVATE ws2_32)
endif()

include(GNUInstallDirs)
install(TARGETS whep-client RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
8 changes: 8 additions & 0 deletions src/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ static const char *whep_name_prefix[] = {
ANSI_COLOR_CYAN"[WHEP]"ANSI_COLOR_RESET" "
};

#if defined(_WIN32)
static inline struct tm *
localtime_r(const time_t *restrict t, struct tm *restrict r)
{
return (localtime_s(r, t) == 0) ? r : NULL;
}
#endif

/* Simple wrapper to g_print/printf */
#define WHEP_PRINT g_print
/* Logger based on different levels, which can either be displayed
Expand Down