[CMake] BUILD_SHARED_LIBS: Fixup for r202261: Give PULIC to system_libs in LLVMSupport.
[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   ConstantRange.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   MemoryBuffer.cpp
40   MemoryObject.cpp
41   MD5.cpp
42   PluginLoader.cpp
43   PrettyStackTrace.cpp
44   Regex.cpp
45   SmallPtrSet.cpp
46   SmallVector.cpp
47   SourceMgr.cpp
48   Statistic.cpp
49   StreamableMemoryObject.cpp
50   StringExtras.cpp
51   StringMap.cpp
52   StringPool.cpp
53   StringRef.cpp
54   StringRefMemoryObject.cpp
55   SystemUtils.cpp
56   Timer.cpp
57   ToolOutputFile.cpp
58   Triple.cpp
59   Twine.cpp
60   Unicode.cpp
61   YAMLParser.cpp
62   YAMLTraits.cpp
63   raw_os_ostream.cpp
64   raw_ostream.cpp
65   regcomp.c
66   regerror.c
67   regexec.c
68   regfree.c
69   regstrlcpy.c
70
71 # System
72   Atomic.cpp
73   Disassembler.cpp
74   DynamicLibrary.cpp
75   Errno.cpp
76   Host.cpp
77   IncludeFile.cpp
78   Memory.cpp
79   Mutex.cpp
80   Path.cpp
81   Process.cpp
82   Program.cpp
83   RWMutex.cpp
84   SearchForAddressOfSpecialSymbol.cpp
85   Signals.cpp
86   system_error.cpp
87   TargetRegistry.cpp
88   ThreadLocal.cpp
89   Threading.cpp
90   TimeValue.cpp
91   Valgrind.cpp
92   Watchdog.cpp
93
94   ADDITIONAL_HEADERS
95   Unix/Host.inc
96   Unix/Memory.inc
97   Unix/Mutex.inc
98   Unix/Path.inc
99   Unix/Process.inc
100   Unix/Program.inc
101   Unix/RWMutex.inc
102   Unix/Signals.inc
103   Unix/system_error.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/system_error.inc
117   Windows/ThreadLocal.inc
118   Windows/TimeValue.inc
119   Windows/Watchdog.inc
120   )
121 set(system_libs)
122 if( NOT MSVC )
123   if( MINGW )
124     set(system_libs ${system_libs} imagehlp psapi shell32)
125   elseif( CMAKE_HOST_UNIX )
126     if( HAVE_LIBRT )
127       set(system_libs ${system_libs} rt)
128     endif()
129     if( HAVE_LIBDL )
130       set(system_libs ${system_libs} ${CMAKE_DL_LIBS})
131     endif()
132     if(LLVM_ENABLE_TERMINFO)
133       if(HAVE_TERMINFO)
134         set(system_libs ${system_libs} ${TERMINFO_LIBS})
135       endif()
136     endif()
137     if( LLVM_ENABLE_THREADS AND HAVE_LIBPTHREAD )
138       set(system_libs ${system_libs} pthread)
139     endif()
140     if ( LLVM_ENABLE_ZLIB AND HAVE_LIBZ )
141       set(system_libs ${system_libs} z)
142     endif()
143   endif( MINGW )
144 endif( NOT MSVC )
145
146
147 if(POLICY CMP0022 AND BUILD_SHARED_LIBS)
148   # FIXME: Should this be really PUBLIC?
149   target_link_libraries(LLVMSupport PUBLIC ${system_libs})
150 else()
151   target_link_libraries(LLVMSupport ${cmake_2_8_12_INTERFACE} ${system_libs})
152 endif()
153
154 set_property(TARGET LLVMSupport PROPERTY LLVM_SYSTEM_LIBS "${system_libs}")