Skip to content

Commit 9cd20cf

Browse files
fix(driver/at/win32): clock_* requires to link librt
MinGW is totally garbage, Glibc since 2.17 have move clock_* from librt to libc so single-thread program can use these functions without the overheads associated with multi-thread support. But MinGW doesn't. Signed-off-by: Coelacanthus <uwu@coelacanthus.name>
1 parent d7be102 commit 9cd20cf

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

driver/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ if (LPAC_WITH_APDU_AT)
8484
if (UNIX)
8585
target_sources(${target_name} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/apdu/at_cmd_unix.c)
8686
elseif (WIN32)
87-
target_link_libraries(${target_name} PRIVATE setupapi)
87+
# FIXME: MinGW is totally garbage, Glibc since 2.17 have move clock_* from librt to libc so single-thread
88+
# program can use these functions without the overheads associated with multi-thread support.
89+
# But MinGW doesn't.
90+
target_link_libraries(${target_name} PRIVATE setupapi rt)
8891
target_sources(${target_name} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/apdu/at_cmd_win32.c)
8992
else ()
9093
message(FATAL_ERROR "${target_name} is only supported on Unix and Windows platforms.")

0 commit comments

Comments
 (0)