Support FindAtomics on NetBSD.

This commit is contained in:
levlam 2024-02-21 18:31:03 +03:00
parent 69908ae3c4
commit edb552df68
2 changed files with 3 additions and 5 deletions

View File

@ -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)

View File

@ -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}"