File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed
cmake/thirdpartylibraries Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -144,6 +144,9 @@ endif()
144144################################
145145# Threads (platform-specific)
146146################################
147+
148+ set (EXACONSTIT_THREADS_EXPLICIT_LINK FALSE CACHE INTERNAL "Whether explicit thread linking is required" )
149+
147150if (UNIX AND NOT APPLE )
148151 find_package (Threads REQUIRED)
149152 include (CheckCXXSourceCompiles)
@@ -194,14 +197,7 @@ if(UNIX AND NOT APPLE)
194197 # Register if needed
195198 if (NOT THREADS_IMPLICIT_LINK)
196199 message (STATUS " Result: Explicit pthread linking REQUIRED" )
197-
198- if (TARGET Threads::Threads)
199- blt_import_library(NAME threads
200- LIBRARIES Threads::Threads)
201- else ()
202- blt_import_library(NAME threads
203- LIBRARIES ${CMAKE_THREAD_LIBS_INIT} )
204- endif ()
200+ set (EXACONSTIT_THREADS_EXPLICIT_LINK TRUE CACHE INTERNAL "Whether explicit thread linking is required" )
205201 else ()
206202 message (STATUS " Result: pthread implicitly linked (no action needed)" )
207203 endif ()
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ endif()
8282set (EXACONSTIT_DEPENDS)
8383
8484exaconstit_fill_depends_list(LIST_NAME EXACONSTIT_DEPENDS
85- DEPENDS_ON mfem ecmech snls RAJA camp mpi threads )
85+ DEPENDS_ON mfem ecmech snls RAJA camp mpi)
8686
8787if (${BLT_VERSION} VERSION_GREATER_EQUAL 0.6.0)
8888 if (ENABLE_CUDA)
@@ -112,6 +112,13 @@ if(ENABLE_CALIPER)
112112 list (APPEND EXACONSTIT_DEPENDS caliper)
113113endif ()
114114
115+ if (UNIX AND NOT APPLE AND TARGET Threads::Threads)
116+ # Check if we determined explicit linking is needed
117+ if (EXACONSTIT_THREADS_EXPLICIT_LINK)
118+ list (APPEND EXACONSTIT_DEPENDS Threads::Threads)
119+ endif ()
120+ endif ()
121+
115122list (APPEND EXACONSTIT_DEPENDS ${DYNAMIC_LOADING_LIBS} )
116123
117124message ("-- EXACONSTIT_DEPENDS: ${EXACONSTIT_DEPENDS} " )
You can’t perform that action at this time.
0 commit comments