[Support/LockFileManager] Make the LockFileManager more robust against races.
[oota-llvm.git] / lib / Support / CMakeLists.txt
1 add_llvm_library(LLVMSupport
2   APFloat.cpp
3   APInt.cpp
4   APSInt.cpp
5   ARMBuildAttrs.cpp
6   Allocator.cpp
7   BlockFrequency.cpp
8   BranchProbability.cpp
9   circular_raw_ostream.cpp
10   CommandLine.cpp
11   Compression.cpp
12   ConvertUTF.c
13   ConvertUTFWrapper.cpp
14   CrashRecoveryContext.cpp
15   DataExtractor.cpp
16   DataStream.cpp
17   Debug.cpp
18   DeltaAlgorithm.cpp
19   DAGDeltaAlgorithm.cpp
20   Dwarf.cpp
21   ErrorHandling.cpp
22   FileUtilities.cpp
23   FileOutputBuffer.cpp
24   FoldingSet.cpp
25   FormattedStream.cpp
26   GraphWriter.cpp
27   Hashing.cpp
28   IntEqClasses.cpp
29   IntervalMap.cpp
30   IntrusiveRefCntPtr.cpp
31   IsInf.cpp
32   IsNAN.cpp
33   LEB128.cpp
34   LineIterator.cpp
35   Locale.cpp
36   LockFileManager.cpp
37   ManagedStatic.cpp
38   MemoryBuffer.cpp
39   MemoryObject.cpp
40   MD5.cpp
41   PluginLoader.cpp
42   PrettyStackTrace.cpp
43   Regex.cpp
44   SmallPtrSet.cpp
45   SmallVector.cpp
46   SourceMgr.cpp
47   Statistic.cpp
48   StreamableMemoryObject.cpp
49   StringExtras.cpp
50   StringMap.cpp
51   StringPool.cpp
52   StringRef.cpp
53   StringRefMemoryObject.cpp
54   SystemUtils.cpp
55   Timer.cpp
56   ToolOutputFile.cpp
57   Triple.cpp
58   Twine.cpp
59   Unicode.cpp
60   YAMLParser.cpp
61   YAMLTraits.cpp
62   raw_os_ostream.cpp
63   raw_ostream.cpp
64   regcomp.c
65   regerror.c
66   regexec.c
67   regfree.c
68   regstrlcpy.c
69
70 # System
71   Atomic.cpp
72   Disassembler.cpp
73   DynamicLibrary.cpp
74   Errno.cpp
75   Host.cpp
76   IncludeFile.cpp
77   Memory.cpp
78   Mutex.cpp
79   Path.cpp
80   Process.cpp
81   Program.cpp
82   RWMutex.cpp
83   SearchForAddressOfSpecialSymbol.cpp
84   Signals.cpp
85   system_error.cpp
86   TargetRegistry.cpp
87   ThreadLocal.cpp
88   Threading.cpp
89   TimeValue.cpp
90   Valgrind.cpp
91   Watchdog.cpp
92
93   ADDITIONAL_HEADERS
94   Unix/Host.inc
95   Unix/Memory.inc
96   Unix/Mutex.inc
97   Unix/Path.inc
98   Unix/Process.inc
99   Unix/Program.inc
100   Unix/RWMutex.inc
101   Unix/Signals.inc
102   Unix/system_error.inc
103   Unix/ThreadLocal.inc
104   Unix/TimeValue.inc
105   Unix/Watchdog.inc
106   Windows/DynamicLibrary.inc
107   Windows/Host.inc
108   Windows/Memory.inc
109   Windows/Mutex.inc
110   Windows/Path.inc
111   Windows/Process.inc
112   Windows/Program.inc
113   Windows/RWMutex.inc
114   Windows/Signals.inc
115   Windows/system_error.inc
116   Windows/ThreadLocal.inc
117   Windows/TimeValue.inc
118   Windows/Watchdog.inc
119   )
120 set(system_libs)
121 if( NOT MSVC )
122   if( MINGW )
123     set(system_libs ${system_libs} imagehlp psapi shell32)
124   elseif( CMAKE_HOST_UNIX )
125     if( HAVE_LIBRT )
126       set(system_libs ${system_libs} rt)
127     endif()
128     if( HAVE_LIBDL )
129       set(system_libs ${system_libs} ${CMAKE_DL_LIBS})
130     endif()
131     if(LLVM_ENABLE_TERMINFO)
132       if(HAVE_TERMINFO)
133         set(system_libs ${system_libs} ${TERMINFO_LIBS})
134       endif()
135     endif()
136     if( LLVM_ENABLE_THREADS AND HAVE_LIBPTHREAD )
137       set(system_libs ${system_libs} pthread)
138     endif()
139     if ( LLVM_ENABLE_ZLIB AND HAVE_LIBZ )
140       set(system_libs ${system_libs} z)
141     endif()
142   endif( MINGW )
143 endif( NOT MSVC )
144
145
146 if(POLICY CMP0022 AND BUILD_SHARED_LIBS)
147   # FIXME: Should this be really PUBLIC?
148   target_link_libraries(LLVMSupport PUBLIC ${system_libs})
149 else()
150   target_link_libraries(LLVMSupport ${cmake_2_8_12_INTERFACE} ${system_libs})
151 endif()
152
153 set_property(TARGET LLVMSupport PROPERTY LLVM_SYSTEM_LIBS "${system_libs}")