Skip to content

Commit

Permalink
Support FindAtomics on NetBSD.
Browse files Browse the repository at this point in the history
  • Loading branch information
levlam committed Feb 21, 2024
1 parent 69908ae commit edb552d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CMake/FindAtomics.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ set(ATOMIC_CODE
}")

set(ATOMICS_LIBS " " "-latomic")
if (CMAKE_SYSTEM_NAME MATCHES "NetBSD")
set(ATOMICS_LIBS "${ATOMICS_LIBS}" /usr/pkg/gcc12/x86_64--netbsd/lib/libatomic.so /usr/pkg/gcc12/i486--netbsdelf/lib/libatomic.so)
endif()

foreach (ATOMICS_LIBRARY ${ATOMICS_LIBS})
unset(ATOMICS_FOUND CACHE)
Expand Down
5 changes: 0 additions & 5 deletions tdutils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -403,11 +403,6 @@ if (ANDROID)
target_link_libraries(tdutils PRIVATE log)
endif()

if (CMAKE_SYSTEM_NAME MATCHES "NetBSD")
target_link_directories(tdutils PUBLIC /usr/pkg/gcc12/x86_64--netbsd/lib /usr/pkg/gcc12/i486--netbsdelf/lib)
target_link_libraries(tdutils PUBLIC atomic)
endif()

install(TARGETS tdutils EXPORT TdStaticTargets
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
Expand Down

0 comments on commit edb552d

Please sign in to comment.