Don't bother checking for Threads when using MSVC

We know that MSVC never needs any special options for using threads, so
skip find_package(Threads) when using it.
This commit is contained in:
Vadim Zeitlin
2025-06-07 19:14:59 +02:00
parent 4d4fd473d4
commit 0558c1466a

View File

@@ -5,8 +5,6 @@ set(SOCI_LIB_SUFFIX "${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE STRING "Specifies suf
set(SOCI_DEBUG_POSTFIX "${CMAKE_DEBUG_POSTFIX}" CACHE STRING "Specifies suffix for the library file in debug mode")
find_package(Threads REQUIRED)
add_library(soci_core
${SOCI_LIB_TYPE}
"backend-loader.cpp"
@@ -156,13 +154,17 @@ if (WITH_BOOST)
endif()
endif()
target_link_libraries(soci_core
PUBLIC
$<BUILD_INTERFACE:soci_compiler_interface>
PRIVATE
Threads::Threads
${CMAKE_DL_LIBS}
)
if (NOT MSVC)
find_package(Threads REQUIRED)
target_link_libraries(soci_core
PUBLIC
$<BUILD_INTERFACE:soci_compiler_interface>
PRIVATE
Threads::Threads
${CMAKE_DL_LIBS}
)
endif()
if (DEFINED ABI_SUFFIX)
set_target_properties(soci_core