1
0
Fork 0
mirror of https://github.com/anrieff/libcpuid synced 2025-10-03 11:01:30 +00:00

Fix build for NetBSD (and presumably DragonFly BSD)

These both use POSIX threads. I got a link error when cross-compiling
using Nixpkgs (Linux -> NetBSD) that went away once I passed `-pthread`.

The autoconf is crafted to have the same conditional as the C code itself.
This commit is contained in:
John Ericson 2023-05-19 00:57:27 -04:00 committed by The Tumultuous Unicorn Of Darkness
commit 09071d20f3
No known key found for this signature in database
GPG key ID: 1E55EE2EFF18BC1A
3 changed files with 40 additions and 0 deletions

View file

@ -23,6 +23,7 @@ add_library(cpuid ${cpuid_sources})
set_property(TARGET cpuid PROPERTY WINDOWS_EXPORT_ALL_SYMBOLS ON)
target_include_directories(cpuid SYSTEM PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
target_link_libraries(cpuid ${CMAKE_THREAD_LIBS_INIT})
target_compile_definitions(cpuid PRIVATE VERSION="${PROJECT_VERSION}")
set_target_properties(cpuid PROPERTIES VERSION "${LIBCPUID_CURRENT}.${LIBCPUID_AGE}.${LIBCPUID_REVISION}")
set_target_properties(cpuid PROPERTIES SOVERSION "${LIBCPUID_CURRENT}")