|
| 1 | +#=========================== begin_copyright_notice ============================ |
| 2 | +# |
| 3 | +# Copyright (c) 2021-2021 Intel Corporation |
| 4 | +# |
| 5 | +# Permission is hereby granted, free of charge, to any person obtaining a copy |
| 6 | +# of this software and associated documentation files (the "Software"), |
| 7 | +# to deal in the Software without restriction, including without limitation |
| 8 | +# the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 9 | +# and/or sell copies of the Software, and to permit persons to whom |
| 10 | +# the Software is furnished to do so, subject to the following conditions: |
| 11 | +# |
| 12 | +# The above copyright notice and this permission notice shall be included |
| 13 | +# in all copies or substantial portions of the Software. |
| 14 | +# |
| 15 | +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 16 | +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 17 | +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 18 | +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 19 | +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 20 | +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
| 21 | +# IN THE SOFTWARE. |
| 22 | +# |
| 23 | +#============================ end_copyright_notice ============================= |
| 24 | + |
| 25 | +include_guard(DIRECTORY) |
| 26 | + |
| 27 | +if(LLVM_LINK_LLVM_DYLIB) |
| 28 | + # LLVM was built and configured in a way that tools (in our case IGC) should be linked |
| 29 | + # against single LLVM dynamic library. |
| 30 | + set(IGC_BUILD__LLVM_LIBS_TO_LINK "LLVM") |
| 31 | + message(STATUS "[IGC] Link against LLVM dynamic library") |
| 32 | +else() |
| 33 | + # LLVM was built into multiple libraries (static or shared). |
| 34 | + message(STATUS "[IGC] Link against LLVM static or shared component libs") |
| 35 | + |
| 36 | + # Link targets/dependencies (in required link order). |
| 37 | + # NOTE: Since the libraries are grouped in the same link group (in GCC/CLANG), |
| 38 | + # there is no longer need to order in most dependant first manner. |
| 39 | + set(IGC_BUILD__LLVM_LIBS_TO_LINK |
| 40 | + "LLVMipo" |
| 41 | + "LLVMIRReader" |
| 42 | + "LLVMBitWriter" |
| 43 | + "LLVMBinaryFormat" |
| 44 | + "LLVMAsmParser" |
| 45 | + "LLVMBitReader" |
| 46 | + "LLVMLinker" |
| 47 | + "LLVMCodeGen" |
| 48 | + "LLVMScalarOpts" |
| 49 | + "LLVMTransformUtils" |
| 50 | + "LLVMAnalysis" |
| 51 | + "LLVMTarget" |
| 52 | + "LLVMObjCARCOpts" |
| 53 | + "LLVMVectorize" |
| 54 | + "LLVMInstrumentation" |
| 55 | + "LLVMObject" |
| 56 | + "LLVMMCParser" |
| 57 | + "LLVMProfileData" |
| 58 | + "LLVMMC" |
| 59 | + "LLVMCore" |
| 60 | + "LLVMSupport" |
| 61 | + "LLVMDemangle" |
| 62 | + ) |
| 63 | + |
| 64 | + if(LLVM_VERSION_MAJOR GREATER_EQUAL 8) |
| 65 | + list(APPEND IGC_BUILD__LLVM_LIBS_TO_LINK |
| 66 | + "LLVMInstCombine" |
| 67 | + ) |
| 68 | + endif() |
| 69 | + |
| 70 | + if(LLVM_VERSION_MAJOR GREATER_EQUAL 9) |
| 71 | + list(APPEND IGC_BUILD__LLVM_LIBS_TO_LINK |
| 72 | + "LLVMBitstreamReader" |
| 73 | + ) |
| 74 | + endif() |
| 75 | +endif() |
| 76 | + |
0 commit comments