mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 10:42:39 +01:00
Refactor duplicated code for linking with pthread.
llvm-svn: 262344
This commit is contained in:
parent
15d5943a07
commit
c165498992
@ -107,6 +107,10 @@ if( NOT PURE_WINDOWS )
|
||||
check_library_exists(rt clock_gettime "" HAVE_LIBRT)
|
||||
endif()
|
||||
|
||||
if(HAVE_LIBPTHREAD)
|
||||
set(PTHREAD_LIB pthread)
|
||||
endif()
|
||||
|
||||
# Don't look for these libraries on Windows. Also don't look for them if we're
|
||||
# using MSan, since uninstrmented third party code may call MSan interceptors
|
||||
# like strlen, leading to false positives.
|
||||
|
@ -11,6 +11,4 @@ add_llvm_example(ParallelJIT
|
||||
ParallelJIT.cpp
|
||||
)
|
||||
|
||||
if(HAVE_LIBPTHREAD)
|
||||
target_link_libraries(ParallelJIT pthread)
|
||||
endif(HAVE_LIBPTHREAD)
|
||||
target_link_libraries(ParallelJIT ${PTHREAD_LIB})
|
||||
|
@ -1,8 +1,3 @@
|
||||
set(system_libs)
|
||||
if(CMAKE_HOST_UNIX AND LLVM_ENABLE_THREADS AND HAVE_LIBPTHREAD)
|
||||
set(system_libs ${system_libs} pthread)
|
||||
endif()
|
||||
|
||||
add_llvm_library(LLVMCodeGen
|
||||
AggressiveAntiDepBreaker.cpp
|
||||
AllocationOrder.cpp
|
||||
@ -135,7 +130,7 @@ add_llvm_library(LLVMCodeGen
|
||||
${LLVM_MAIN_INCLUDE_DIR}/llvm/CodeGen
|
||||
${LLVM_MAIN_INCLUDE_DIR}/llvm/CodeGen/PBQP
|
||||
|
||||
LINK_LIBS ${system_libs}
|
||||
LINK_LIBS ${PTHREAD_LIB}
|
||||
)
|
||||
|
||||
add_dependencies(LLVMCodeGen intrinsics_gen)
|
||||
|
@ -3,9 +3,9 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/.. )
|
||||
if( HAVE_LIBDL )
|
||||
set(LLVM_INTEL_JIT_LIBS ${CMAKE_DL_LIBS})
|
||||
endif()
|
||||
if( HAVE_LIBPTHREAD )
|
||||
set(LLVM_INTEL_JIT_LIBS pthread ${LLVM_INTEL_JIT_LIBS})
|
||||
endif()
|
||||
|
||||
set(LLVM_INTEL_JIT_LIBS ${PTHREAD_LIB} ${LLVM_INTEL_JIT_LIBS})
|
||||
|
||||
|
||||
add_llvm_library(LLVMIntelJITEvents
|
||||
IntelJITEventListener.cpp
|
||||
|
@ -18,16 +18,12 @@ if( LLVM_USE_SANITIZE_COVERAGE )
|
||||
add_library(LLVMFuzzerNoMain STATIC
|
||||
$<TARGET_OBJECTS:LLVMFuzzerNoMainObjects>
|
||||
)
|
||||
if( HAVE_LIBPTHREAD )
|
||||
target_link_libraries(LLVMFuzzerNoMain pthread)
|
||||
endif()
|
||||
target_link_libraries(LLVMFuzzerNoMain ${PTHREAD_LIB})
|
||||
add_library(LLVMFuzzer STATIC
|
||||
FuzzerMain.cpp
|
||||
$<TARGET_OBJECTS:LLVMFuzzerNoMainObjects>
|
||||
)
|
||||
if( HAVE_LIBPTHREAD )
|
||||
target_link_libraries(LLVMFuzzer pthread)
|
||||
endif()
|
||||
target_link_libraries(LLVMFuzzer ${PTHREAD_LIB})
|
||||
|
||||
if( LLVM_INCLUDE_TESTS )
|
||||
add_subdirectory(test)
|
||||
|
@ -17,9 +17,7 @@ elseif( CMAKE_HOST_UNIX )
|
||||
if( LLVM_ENABLE_THREADS AND HAVE_LIBATOMIC )
|
||||
set(system_libs ${system_libs} atomic)
|
||||
endif()
|
||||
if( LLVM_ENABLE_THREADS AND HAVE_LIBPTHREAD )
|
||||
set(system_libs ${system_libs} pthread)
|
||||
endif()
|
||||
set(system_libs ${system_libs} ${PTHREAD_LIB})
|
||||
if ( LLVM_ENABLE_ZLIB AND HAVE_LIBZ )
|
||||
set(system_libs ${system_libs} z)
|
||||
endif()
|
||||
|
@ -53,6 +53,4 @@ add_llvm_unittest(SupportTests
|
||||
)
|
||||
|
||||
# ManagedStatic.cpp uses <pthread>.
|
||||
if(LLVM_ENABLE_THREADS AND HAVE_LIBPTHREAD)
|
||||
target_link_libraries(SupportTests pthread)
|
||||
endif()
|
||||
target_link_libraries(SupportTests ${PTHREAD_LIB})
|
||||
|
Loading…
Reference in New Issue
Block a user