8ba992a40be720539731673a73d8eb2449ffa8e6
[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   ARMWinEH.cpp
7   Allocator.cpp
8   BlockFrequency.cpp
9   BranchProbability.cpp
10   circular_raw_ostream.cpp
11   CommandLine.cpp
12   Compression.cpp
13   ConvertUTF.c
14   ConvertUTFWrapper.cpp
15   CrashRecoveryContext.cpp
16   DataExtractor.cpp
17   DataStream.cpp
18   Debug.cpp
19   DeltaAlgorithm.cpp
20   DAGDeltaAlgorithm.cpp
21   Dwarf.cpp
22   ErrorHandling.cpp
23   FileUtilities.cpp
24   FileOutputBuffer.cpp
25   FoldingSet.cpp
26   FormattedStream.cpp
27   GraphWriter.cpp
28   Hashing.cpp
29   IntEqClasses.cpp
30   IntervalMap.cpp
31   IntrusiveRefCntPtr.cpp
32   IsInf.cpp
33   IsNAN.cpp
34   LEB128.cpp
35   LineIterator.cpp
36   Locale.cpp
37   LockFileManager.cpp
38   ManagedStatic.cpp
39   MathExtras.cpp
40   MemoryBuffer.cpp
41   MemoryObject.cpp
42   MD5.cpp
43   PluginLoader.cpp
44   PrettyStackTrace.cpp
45   RandomNumberGenerator.cpp
46   Regex.cpp
47   ScaledNumber.cpp
48   SmallPtrSet.cpp
49   SmallVector.cpp
50   SourceMgr.cpp
51   SpecialCaseList.cpp
52   Statistic.cpp
53   StreamableMemoryObject.cpp
54   StringExtras.cpp
55   StringMap.cpp
56   StringPool.cpp
57   StringRef.cpp
58   StringRefMemoryObject.cpp
59   SystemUtils.cpp
60   Timer.cpp
61   ToolOutputFile.cpp
62   Triple.cpp
63   Twine.cpp
64   Unicode.cpp
65   YAMLParser.cpp
66   YAMLTraits.cpp
67   raw_os_ostream.cpp
68   raw_ostream.cpp
69   regcomp.c
70   regerror.c
71   regexec.c
72   regfree.c
73   regstrlcpy.c
74
75 # System
76   Atomic.cpp
77   DynamicLibrary.cpp
78   Errno.cpp
79   Host.cpp
80   Memory.cpp
81   Mutex.cpp
82   Path.cpp
83   Process.cpp
84   Program.cpp
85   RWMutex.cpp
86   SearchForAddressOfSpecialSymbol.cpp
87   Signals.cpp
88   TargetRegistry.cpp
89   ThreadLocal.cpp
90   Threading.cpp
91   TimeValue.cpp
92   Valgrind.cpp
93   Watchdog.cpp
94
95   ADDITIONAL_HEADERS
96   Unix/Host.inc
97   Unix/Memory.inc
98   Unix/Mutex.inc
99   Unix/Path.inc
100   Unix/Process.inc
101   Unix/Program.inc
102   Unix/RWMutex.inc
103   Unix/Signals.inc
104   Unix/ThreadLocal.inc
105   Unix/TimeValue.inc
106   Unix/Watchdog.inc
107   Windows/DynamicLibrary.inc
108   Windows/Host.inc
109   Windows/Memory.inc
110   Windows/Mutex.inc
111   Windows/Path.inc
112   Windows/Process.inc
113   Windows/Program.inc
114   Windows/RWMutex.inc
115   Windows/Signals.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_LIBATOMIC )
137       set(system_libs ${system_libs} atomic)
138     endif()
139     if( LLVM_ENABLE_THREADS AND HAVE_LIBPTHREAD )
140       set(system_libs ${system_libs} pthread)
141     endif()
142     if ( LLVM_ENABLE_ZLIB AND HAVE_LIBZ )
143       set(system_libs ${system_libs} z)
144     endif()
145   endif( MINGW )
146 endif( NOT MSVC )
147
148
149 if(POLICY CMP0022 AND BUILD_SHARED_LIBS)
150   # FIXME: Should this be really PUBLIC?
151   target_link_libraries(LLVMSupport PUBLIC ${system_libs})
152 else()
153   target_link_libraries(LLVMSupport ${cmake_2_8_12_INTERFACE} ${system_libs})
154 endif()
155
156 set_property(TARGET LLVMSupport PROPERTY LLVM_SYSTEM_LIBS "${system_libs}")