Skip to content

Commit

Permalink
Only link rt for Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
dudoslav committed Apr 3, 2024
1 parent 208b68a commit 124e9c1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions ports/libfaketime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ add_library(
src/libfaketime.c
)

target_link_libraries(
${PROJECT_NAME}
rt
)
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
target_link_libraries(
${PROJECT_NAME}
rt
)
endif()

target_include_directories(${PROJECT_NAME}
PUBLIC
Expand Down
4 changes: 2 additions & 2 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,8 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux" AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU
)
endif()

# Only produce timing tests for Linux based systems (faketime constraint)
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
# Only produce timing tests for UNIX based systems (faketime constraint)
if (NOT MSVC)
find_package(unofficial-libfaketime REQUIRED)

# unit test executable
Expand Down

0 comments on commit 124e9c1

Please sign in to comment.