mirror of
https://github.com/simdjson/simdjson
synced 2026-06-08 17:27:07 +00:00
CMake: Link Threads the old-style
If linked against Threads::Threads target while building static libraries, cmake cannot find the threads library while trying to use the installed target afterwards
This commit is contained in:
@@ -73,7 +73,9 @@ endif()
|
||||
option(SIMDJSON_ENABLE_THREADS "Enable threaded operation" ON)
|
||||
if(SIMDJSON_ENABLE_THREADS)
|
||||
find_package(Threads REQUIRED)
|
||||
target_link_libraries(simdjson-flags INTERFACE Threads::Threads)
|
||||
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
|
||||
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
|
||||
target_link_libraries(simdjson-flags INTERFACE ${CMAKE_THREAD_LIBS_INIT} )
|
||||
endif()
|
||||
|
||||
option(SIMDJSON_SANITIZE "Sanitize addresses" OFF)
|
||||
|
||||
Reference in New Issue
Block a user