llvm.org GIT mirror llvm / 93ed620
Refactor duplicated code for linking with pthread. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262344 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 4 years ago
7 changed file(s) with 13 addition(s) and 24 deletion(s). Raw diff Collapse all Expand all
104104 endif()
105105 check_library_exists(dl dlopen "" HAVE_LIBDL)
106106 check_library_exists(rt clock_gettime "" HAVE_LIBRT)
107 endif()
108
109 if(HAVE_LIBPTHREAD)
110 set(PTHREAD_LIB pthread)
107111 endif()
108112
109113 # Don't look for these libraries on Windows. Also don't look for them if we're
1010 ParallelJIT.cpp
1111 )
1212
13 if(HAVE_LIBPTHREAD)
14 target_link_libraries(ParallelJIT pthread)
15 endif(HAVE_LIBPTHREAD)
13 target_link_libraries(ParallelJIT ${PTHREAD_LIB})
None set(system_libs)
1 if(CMAKE_HOST_UNIX AND LLVM_ENABLE_THREADS AND HAVE_LIBPTHREAD)
2 set(system_libs ${system_libs} pthread)
3 endif()
4
5 add_llvm_library(LLVMCodeGen
61 AggressiveAntiDepBreaker.cpp
72 AllocationOrder.cpp
134129 ${LLVM_MAIN_INCLUDE_DIR}/llvm/CodeGen
135130 ${LLVM_MAIN_INCLUDE_DIR}/llvm/CodeGen/PBQP
136131
137 LINK_LIBS ${system_libs}
132 LINK_LIBS ${PTHREAD_LIB}
138133 )
139134
140135 add_dependencies(LLVMCodeGen intrinsics_gen)
22 if( HAVE_LIBDL )
33 set(LLVM_INTEL_JIT_LIBS ${CMAKE_DL_LIBS})
44 endif()
5 if( HAVE_LIBPTHREAD )
6 set(LLVM_INTEL_JIT_LIBS pthread ${LLVM_INTEL_JIT_LIBS})
7 endif()
5
6 set(LLVM_INTEL_JIT_LIBS ${PTHREAD_LIB} ${LLVM_INTEL_JIT_LIBS})
7
88
99 add_llvm_library(LLVMIntelJITEvents
1010 IntelJITEventListener.cpp
1717 add_library(LLVMFuzzerNoMain STATIC
1818 $
1919 )
20 if( HAVE_LIBPTHREAD )
21 target_link_libraries(LLVMFuzzerNoMain pthread)
22 endif()
20 target_link_libraries(LLVMFuzzerNoMain ${PTHREAD_LIB})
2321 add_library(LLVMFuzzer STATIC
2422 FuzzerMain.cpp
2523 $
2624 )
27 if( HAVE_LIBPTHREAD )
28 target_link_libraries(LLVMFuzzer pthread)
29 endif()
25 target_link_libraries(LLVMFuzzer ${PTHREAD_LIB})
3026
3127 if( LLVM_INCLUDE_TESTS )
3228 add_subdirectory(test)
1616 if( LLVM_ENABLE_THREADS AND HAVE_LIBATOMIC )
1717 set(system_libs ${system_libs} atomic)
1818 endif()
19 if( LLVM_ENABLE_THREADS AND HAVE_LIBPTHREAD )
20 set(system_libs ${system_libs} pthread)
21 endif()
19 set(system_libs ${system_libs} ${PTHREAD_LIB})
2220 if ( LLVM_ENABLE_ZLIB AND HAVE_LIBZ )
2321 set(system_libs ${system_libs} z)
2422 endif()
5252 )
5353
5454 # ManagedStatic.cpp uses .
55 if(LLVM_ENABLE_THREADS AND HAVE_LIBPTHREAD)
56 target_link_libraries(SupportTests pthread)
57 endif()
55 target_link_libraries(SupportTests ${PTHREAD_LIB})