diff --git a/.CMake/compiler_opts.cmake b/.CMake/compiler_opts.cmake index 083529b32c..33fd2c24db 100644 --- a/.CMake/compiler_opts.cmake +++ b/.CMake/compiler_opts.cmake @@ -104,10 +104,8 @@ if(CMAKE_C_COMPILER_ID MATCHES "Clang") add_link_options("-Wl,-z,noexecstack") endif() - if(NOT ${OQS_BUILD_ONLY_LIB}) - set(THREADS_PREFER_PTHREAD_FLAG ON) - find_package(Threads) - endif() + set(THREADS_PREFER_PTHREAD_FLAG ON) + find_package(Threads) if(${OQS_DEBUG_BUILD}) add_compile_options(-g3) @@ -165,10 +163,8 @@ elseif(CMAKE_C_COMPILER_ID STREQUAL "GNU") endif() endif() - if(NOT ${OQS_BUILD_ONLY_LIB}) - set(THREADS_PREFER_PTHREAD_FLAG ON) - find_package(Threads) - endif() + set(THREADS_PREFER_PTHREAD_FLAG ON) + find_package(Threads) if(${OQS_DEBUG_BUILD}) add_compile_options (-Wstrict-overflow)