Antonio Maiorano | 4bde1c3 | 2020-03-27 15:01:53 -0400 | [diff] [blame] | 1 | # Copyright 2020 The SwiftShader Authors. All Rights Reserved. |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | set(LLVM_SUBZERO_SRC_FILES |
| 16 | "build/Android/include/llvm/Config/abi-breaking.h" |
| 17 | "build/Android/include/llvm/Config/config.h" |
| 18 | "build/Android/include/llvm/Config/llvm-config.h" |
| 19 | "build/Android/include/llvm/Support/DataTypes.h" |
| 20 | "build/Fuchsia/include/llvm/Config/abi-breaking.h" |
| 21 | "build/Fuchsia/include/llvm/Config/config.h" |
| 22 | "build/Fuchsia/include/llvm/Config/llvm-config.h" |
| 23 | "build/Fuchsia/include/llvm/Support/DataTypes.h" |
| 24 | "build/Linux/include/llvm/Config/abi-breaking.h" |
| 25 | "build/Linux/include/llvm/Config/config.h" |
| 26 | "build/Linux/include/llvm/Config/llvm-config.h" |
| 27 | "build/Linux/include/llvm/Support/DataTypes.h" |
| 28 | "build/MacOS/include/llvm/Config/abi-breaking.h" |
| 29 | "build/MacOS/include/llvm/Config/config.h" |
| 30 | "build/MacOS/include/llvm/Config/llvm-config.h" |
| 31 | "build/MacOS/include/llvm/Support/DataTypes.h" |
| 32 | "build/Windows/include/llvm/Config/abi-breaking.h" |
| 33 | "build/Windows/include/llvm/Config/config.h" |
| 34 | "build/Windows/include/llvm/Config/llvm-config.h" |
| 35 | "build/Windows/include/llvm/Support/DataTypes.h" |
| 36 | "include/llvm-c/ErrorHandling.h" |
| 37 | "include/llvm-c/Support.h" |
| 38 | "include/llvm-c/Types.h" |
| 39 | "include/llvm/ADT/APFloat.h" |
| 40 | "include/llvm/ADT/APInt.h" |
| 41 | "include/llvm/ADT/ArrayRef.h" |
| 42 | "include/llvm/ADT/BitVector.h" |
| 43 | "include/llvm/ADT/DenseMap.h" |
| 44 | "include/llvm/ADT/DenseMapInfo.h" |
| 45 | "include/llvm/ADT/edit_distance.h" |
| 46 | "include/llvm/ADT/EpochTracker.h" |
Antonio Maiorano | 4bde1c3 | 2020-03-27 15:01:53 -0400 | [diff] [blame] | 47 | "include/llvm/ADT/Hashing.h" |
| 48 | "include/llvm/ADT/ilist_base.h" |
| 49 | "include/llvm/ADT/ilist_iterator.h" |
| 50 | "include/llvm/ADT/ilist_node_base.h" |
| 51 | "include/llvm/ADT/ilist_node_options.h" |
| 52 | "include/llvm/ADT/ilist_node.h" |
| 53 | "include/llvm/ADT/ilist.h" |
| 54 | "include/llvm/ADT/IntrusiveRefCntPtr.h" |
| 55 | "include/llvm/ADT/iterator_range.h" |
| 56 | "include/llvm/ADT/iterator.h" |
| 57 | "include/llvm/ADT/None.h" |
| 58 | "include/llvm/ADT/Optional.h" |
| 59 | "include/llvm/ADT/PointerIntPair.h" |
| 60 | "include/llvm/ADT/PointerUnion.h" |
| 61 | "include/llvm/ADT/simple_ilist.h" |
| 62 | "include/llvm/ADT/SmallPtrSet.h" |
| 63 | "include/llvm/ADT/SmallSet.h" |
| 64 | "include/llvm/ADT/SmallString.h" |
| 65 | "include/llvm/ADT/SmallVector.h" |
| 66 | "include/llvm/ADT/Statistic.h" |
| 67 | "include/llvm/ADT/STLExtras.h" |
| 68 | "include/llvm/ADT/StringExtras.h" |
| 69 | "include/llvm/ADT/StringMap.h" |
| 70 | "include/llvm/ADT/StringRef.h" |
| 71 | "include/llvm/ADT/StringSwitch.h" |
Antonio Maiorano | 4bde1c3 | 2020-03-27 15:01:53 -0400 | [diff] [blame] | 72 | "include/llvm/ADT/Twine.h" |
| 73 | "include/llvm/Demangle/Demangle.h" |
| 74 | "include/llvm/IR/Argument.h" |
| 75 | "include/llvm/IR/Attributes.h" |
| 76 | "include/llvm/IR/BasicBlock.h" |
| 77 | "include/llvm/IR/CallingConv.h" |
| 78 | "include/llvm/IR/Constant.h" |
| 79 | "include/llvm/IR/DebugLoc.h" |
| 80 | "include/llvm/IR/DerivedTypes.h" |
| 81 | "include/llvm/IR/Function.h" |
| 82 | "include/llvm/IR/GlobalObject.h" |
| 83 | "include/llvm/IR/GlobalValue.h" |
| 84 | "include/llvm/IR/Instruction.h" |
| 85 | "include/llvm/IR/Intrinsics.h" |
| 86 | "include/llvm/IR/LLVMContext.h" |
| 87 | "include/llvm/IR/Metadata.h" |
| 88 | "include/llvm/IR/OperandTraits.h" |
| 89 | "include/llvm/IR/SymbolTableListTraits.h" |
| 90 | "include/llvm/IR/TrackingMDRef.h" |
| 91 | "include/llvm/IR/Type.h" |
| 92 | "include/llvm/IR/Use.h" |
| 93 | "include/llvm/IR/User.h" |
| 94 | "include/llvm/IR/Value.h" |
| 95 | "include/llvm/IRReader/IRReader.h" |
| 96 | "include/llvm/Support/AlignOf.h" |
| 97 | "include/llvm/Support/Allocator.h" |
| 98 | "include/llvm/Support/ARMBuildAttributes.h" |
| 99 | "include/llvm/Support/Atomic.h" |
| 100 | "include/llvm/Support/Casting.h" |
| 101 | "include/llvm/Support/CBindingWrapping.h" |
| 102 | "include/llvm/Support/Chrono.h" |
| 103 | "include/llvm/Support/circular_raw_ostream.h" |
| 104 | "include/llvm/Support/COFF.h" |
| 105 | "include/llvm/Support/CommandLine.h" |
| 106 | "include/llvm/Support/Compiler.h" |
| 107 | "include/llvm/Support/ConvertUTF.h" |
| 108 | "include/llvm/Support/DataStream.h" |
| 109 | "include/llvm/Support/Debug.h" |
| 110 | "include/llvm/Support/ELF.h" |
| 111 | "include/llvm/Support/Endian.h" |
| 112 | "include/llvm/Support/Errc.h" |
| 113 | "include/llvm/Support/Errno.h" |
| 114 | "include/llvm/Support/Error.h" |
| 115 | "include/llvm/Support/ErrorHandling.h" |
| 116 | "include/llvm/Support/ErrorOr.h" |
| 117 | "include/llvm/Support/FileSystem.h" |
| 118 | "include/llvm/Support/FileUtilities.h" |
| 119 | "include/llvm/Support/Format.h" |
| 120 | "include/llvm/Support/FormatCommon.h" |
| 121 | "include/llvm/Support/FormatProviders.h" |
| 122 | "include/llvm/Support/FormatVariadic.h" |
| 123 | "include/llvm/Support/FormatVariadicDetails.h" |
Antonio Maiorano | 4bde1c3 | 2020-03-27 15:01:53 -0400 | [diff] [blame] | 124 | "include/llvm/Support/MachO.h" |
| 125 | "include/llvm/Support/ManagedStatic.h" |
| 126 | "include/llvm/Support/MathExtras.h" |
| 127 | "include/llvm/Support/MD5.h" |
| 128 | "include/llvm/Support/Memory.h" |
| 129 | "include/llvm/Support/MemoryBuffer.h" |
| 130 | "include/llvm/Support/MemoryObject.h" |
| 131 | "include/llvm/Support/Mutex.h" |
| 132 | "include/llvm/Support/MutexGuard.h" |
| 133 | "include/llvm/Support/NativeFormatting.h" |
| 134 | "include/llvm/Support/Options.h" |
| 135 | "include/llvm/Support/Path.h" |
| 136 | "include/llvm/Support/PointerLikeTypeTraits.h" |
| 137 | "include/llvm/Support/Process.h" |
| 138 | "include/llvm/Support/Program.h" |
| 139 | "include/llvm/Support/raw_os_ostream.h" |
| 140 | "include/llvm/Support/raw_ostream.h" |
| 141 | "include/llvm/Support/Regex.h" |
| 142 | "include/llvm/Support/Signals.h" |
| 143 | "include/llvm/Support/SMLoc.h" |
| 144 | "include/llvm/Support/SourceMgr.h" |
| 145 | "include/llvm/Support/StreamingMemoryObject.h" |
| 146 | "include/llvm/Support/StringSaver.h" |
| 147 | "include/llvm/Support/SwapByteOrder.h" |
Antonio Maiorano | 4bde1c3 | 2020-03-27 15:01:53 -0400 | [diff] [blame] | 148 | "include/llvm/Support/thread.h" |
| 149 | "include/llvm/Support/Threading.h" |
| 150 | "include/llvm/Support/Timer.h" |
| 151 | "include/llvm/Support/TimeValue.h" |
| 152 | "include/llvm/Support/type_traits.h" |
| 153 | "include/llvm/Support/UniqueLock.h" |
| 154 | "include/llvm/Support/Valgrind.h" |
| 155 | "include/llvm/Support/WindowsError.h" |
| 156 | "include/llvm/Support/YAMLParser.h" |
| 157 | "include/llvm/Support/YAMLTraits.h" |
| 158 | "lib/Demangle/ItaniumDemangle.cpp" |
| 159 | "lib/Support/APInt.cpp" |
| 160 | "lib/Support/Atomic.cpp" |
| 161 | "lib/Support/circular_raw_ostream.cpp" |
| 162 | "lib/Support/CommandLine.cpp" |
| 163 | "lib/Support/ConvertUTF.cpp" |
| 164 | "lib/Support/ConvertUTFWrapper.cpp" |
| 165 | "lib/Support/Debug.cpp" |
| 166 | "lib/Support/Errno.cpp" |
| 167 | "lib/Support/ErrorHandling.cpp" |
Antonio Maiorano | 4bde1c3 | 2020-03-27 15:01:53 -0400 | [diff] [blame] | 168 | "lib/Support/Hashing.cpp" |
Antonio Maiorano | 4bde1c3 | 2020-03-27 15:01:53 -0400 | [diff] [blame] | 169 | "lib/Support/ManagedStatic.cpp" |
| 170 | "lib/Support/MemoryBuffer.cpp" |
| 171 | "lib/Support/Mutex.cpp" |
| 172 | "lib/Support/NativeFormatting.cpp" |
| 173 | "lib/Support/Path.cpp" |
| 174 | "lib/Support/Process.cpp" |
| 175 | "lib/Support/Program.cpp" |
| 176 | "lib/Support/raw_os_ostream.cpp" |
| 177 | "lib/Support/raw_ostream.cpp" |
| 178 | "lib/Support/regcclass.h" |
| 179 | "lib/Support/regcname.h" |
| 180 | "lib/Support/regcomp.c" |
| 181 | "lib/Support/regerror.c" |
| 182 | "lib/Support/regex_impl.h" |
| 183 | "lib/Support/Regex.cpp" |
| 184 | "lib/Support/regex2.h" |
| 185 | "lib/Support/regexec.c" |
| 186 | "lib/Support/regfree.c" |
| 187 | "lib/Support/regstrlcpy.c" |
| 188 | "lib/Support/regutils.h" |
| 189 | "lib/Support/Signals.cpp" |
| 190 | "lib/Support/SmallPtrSet.cpp" |
| 191 | "lib/Support/SmallVector.cpp" |
| 192 | "lib/Support/StringExtras.cpp" |
| 193 | "lib/Support/StringMap.cpp" |
| 194 | "lib/Support/StringRef.cpp" |
| 195 | "lib/Support/StringSaver.cpp" |
Antonio Maiorano | 4bde1c3 | 2020-03-27 15:01:53 -0400 | [diff] [blame] | 196 | "lib/Support/Threading.cpp" |
| 197 | "lib/Support/Timer.cpp" |
Antonio Maiorano | 4bde1c3 | 2020-03-27 15:01:53 -0400 | [diff] [blame] | 198 | "lib/Support/Twine.cpp" |
| 199 | "lib/Support/Unix/Unix.h" |
| 200 | "lib/Support/Windows/WindowsSupport.h" |
| 201 | ) |
| 202 | |
| 203 | |
| 204 | if(WIN32) |
| 205 | set(LLVM_SUBZERO_PLATFORM_INCLUDE_DIR "build/Windows/include") |
| 206 | elseif(LINUX) |
| 207 | set(LLVM_SUBZERO_PLATFORM_INCLUDE_DIR "build/Linux/include") |
| 208 | elseif(APPLE) |
| 209 | set(LLVM_SUBZERO_PLATFORM_INCLUDE_DIR "build/MacOS/include") |
| 210 | endif() |
| 211 | |
| 212 | if(WIN32) |
| 213 | list(APPEND LLVM_SUBZERO_COMPILE_OPTIONS |
| 214 | "/wd4141" # 'inline': used more than once |
| 215 | "/wd4146" # unary minus operator applied to unsigned type, result still unsigned |
| 216 | "/wd4244" # '=': conversion from '__int64' to 'llvm_regoff_t', possible loss of data |
| 217 | "/wd4267" # '=': conversion from 'size_t' to 'sopno', possible loss of data |
| 218 | "/wd4291" # 'void *operator new(size_t,const `anonymous-namespace'::NamedBufferAlloc &)': no matching operator delete found; memory will not be freed if initialization throws an exception |
| 219 | "/wd4334" # ''operator' : result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) |
| 220 | "/wd4996" # The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: new_name. |
| 221 | ) |
| 222 | endif() |
| 223 | |
| 224 | add_library(llvm-subzero STATIC EXCLUDE_FROM_ALL |
| 225 | ${LLVM_SUBZERO_SRC_FILES} |
| 226 | ) |
| 227 | |
| 228 | set_target_properties(llvm-subzero PROPERTIES |
| 229 | POSITION_INDEPENDENT_CODE 1 |
Antonio Maiorano | 4bde1c3 | 2020-03-27 15:01:53 -0400 | [diff] [blame] | 230 | ) |
| 231 | |
| 232 | target_include_directories(llvm-subzero |
| 233 | PUBLIC |
| 234 | "include" |
| 235 | ${LLVM_SUBZERO_PLATFORM_INCLUDE_DIR} |
| 236 | ) |
| 237 | |
| 238 | target_compile_options(llvm-subzero |
| 239 | PUBLIC |
| 240 | ${LLVM_SUBZERO_COMPILE_OPTIONS} |
| 241 | ) |