Tobias Grosser | 7580537 | 2011-04-29 06:27:02 | [diff] [blame] | 1 | set(LLVM_NO_RTTI 1) |
2 | |||||
Tobias Grosser | 23f16b1 | 2014-03-03 19:30:19 | [diff] [blame] | 3 | set(POLLY_JSON_FILES |
4 | JSON/json_reader.cpp | ||||
5 | JSON/json_value.cpp | ||||
6 | JSON/json_writer.cpp | ||||
7 | ) | ||||
Tobias Grosser | 7580537 | 2011-04-29 06:27:02 | [diff] [blame] | 8 | |
Tobias Grosser | 23f16b1 | 2014-03-03 19:30:19 | [diff] [blame] | 9 | set(ISL_CODEGEN_FILES |
10 | CodeGen/IslAst.cpp | ||||
Johannes Doerfert | 48cf6ec | 2014-07-29 20:50:09 | [diff] [blame] | 11 | CodeGen/IslExprBuilder.cpp |
Tobias Grosser | 0c55cb6 | 2015-04-27 12:32:24 | [diff] [blame] | 12 | CodeGen/IslNodeBuilder.cpp |
Tobias Grosser | 09d3069 | 2015-05-12 07:45:52 | [diff] [blame] | 13 | CodeGen/CodeGeneration.cpp) |
Tobias Grosser | 23f16b1 | 2014-03-03 19:30:19 | [diff] [blame] | 14 | |
15 | if (GPU_CODEGEN) | ||||
Tobias Grosser | 9dfe4e7 | 2016-07-13 15:54:58 | [diff] [blame] | 16 | set (GPGPU_CODEGEN_FILES |
17 | CodeGen/PPCGCodeGeneration.cpp | ||||
18 | ) | ||||
Tobias Grosser | 23f16b1 | 2014-03-03 19:30:19 | [diff] [blame] | 19 | endif (GPU_CODEGEN) |
20 | |||||
Michael Kruse | 519b3cf | 2015-09-24 11:30:22 | [diff] [blame] | 21 | # Compile ISL into a separate library. |
22 | add_subdirectory(External) | ||||
Tobias Grosser | 52a2523 | 2015-02-04 20:55:43 | [diff] [blame] | 23 | |
Michael Kruse | ef3cf01 | 2015-09-11 09:01:55 | [diff] [blame] | 24 | set(POLLY_HEADER_FILES) |
25 | if (MSVC_IDE OR XCODE) | ||||
26 | file(GLOB_RECURSE POLLY_HEADER_FILES "${POLLY_SOURCE_DIR}/include/polly/*.h") | ||||
27 | endif () | ||||
Tobias Grosser | 52a2523 | 2015-02-04 20:55:43 | [diff] [blame] | 28 | |
Andreas Simbuerger | 7f97f8c | 2014-03-11 21:26:02 | [diff] [blame] | 29 | add_polly_library(Polly |
Johannes Doerfert | f6557f9 | 2015-03-04 22:43:40 | [diff] [blame] | 30 | Analysis/DependenceInfo.cpp |
Johannes Doerfert | 8031238 | 2016-07-25 12:48:45 | [diff] [blame] | 31 | Analysis/PolyhedralInfo.cpp |
Tobias Grosser | 23f16b1 | 2014-03-03 19:30:19 | [diff] [blame] | 32 | Analysis/ScopDetection.cpp |
Andreas Simbuerger | 320af405 | 2014-05-24 09:24:53 | [diff] [blame] | 33 | Analysis/ScopDetectionDiagnostic.cpp |
Tobias Grosser | 23f16b1 | 2014-03-03 19:30:19 | [diff] [blame] | 34 | Analysis/ScopInfo.cpp |
Michael Kruse | 2133cb9 | 2016-06-28 01:37:20 | [diff] [blame] | 35 | Analysis/ScopBuilder.cpp |
Tobias Grosser | 23f16b1 | 2014-03-03 19:30:19 | [diff] [blame] | 36 | Analysis/ScopGraphPrinter.cpp |
37 | Analysis/ScopPass.cpp | ||||
Tobias Grosser | 23f16b1 | 2014-03-03 19:30:19 | [diff] [blame] | 38 | CodeGen/BlockGenerators.cpp |
Tobias Grosser | 23f16b1 | 2014-03-03 19:30:19 | [diff] [blame] | 39 | ${ISL_CODEGEN_FILES} |
40 | CodeGen/LoopGenerators.cpp | ||||
Tobias Grosser | 37c9b8e | 2014-03-04 14:59:00 | [diff] [blame] | 41 | CodeGen/IRBuilder.cpp |
Tobias Grosser | 23f16b1 | 2014-03-03 19:30:19 | [diff] [blame] | 42 | CodeGen/Utils.cpp |
Johannes Doerfert | efa85040 | 2014-07-25 17:49:55 | [diff] [blame] | 43 | CodeGen/RuntimeDebugBuilder.cpp |
Michael Kruse | 4c86a1d | 2015-11-26 12:36:25 | [diff] [blame] | 44 | CodeGen/CodegenCleanup.cpp |
Tobias Grosser | 23f16b1 | 2014-03-03 19:30:19 | [diff] [blame] | 45 | ${GPGPU_CODEGEN_FILES} |
Andreas Simbuerger | 19523ed | 2014-03-11 21:25:59 | [diff] [blame] | 46 | Exchange/JSONExporter.cpp |
Tobias Grosser | 23f16b1 | 2014-03-03 19:30:19 | [diff] [blame] | 47 | Support/GICHelper.cpp |
Johannes Doerfert | 574182d | 2015-08-12 10:19:50 | [diff] [blame] | 48 | Support/SCEVAffinator.cpp |
Tobias Grosser | 23f16b1 | 2014-03-03 19:30:19 | [diff] [blame] | 49 | Support/SCEVValidator.cpp |
Andreas Simbuerger | 8dbe338 | 2014-03-11 21:26:06 | [diff] [blame] | 50 | Support/RegisterPasses.cpp |
Tobias Grosser | 23f16b1 | 2014-03-03 19:30:19 | [diff] [blame] | 51 | Support/ScopHelper.cpp |
Tobias Grosser | a63b7ce | 2015-05-03 05:21:36 | [diff] [blame] | 52 | Support/ScopLocation.cpp |
Tobias Grosser | 23f16b1 | 2014-03-03 19:30:19 | [diff] [blame] | 53 | ${POLLY_JSON_FILES} |
Andreas Simbuerger | 19523ed | 2014-03-11 21:25:59 | [diff] [blame] | 54 | Transform/Canonicalization.cpp |
55 | Transform/CodePreparation.cpp | ||||
56 | Transform/DeadCodeElimination.cpp | ||||
Andreas Simbuerger | 19523ed | 2014-03-11 21:25:59 | [diff] [blame] | 57 | Transform/ScheduleOptimizer.cpp |
Michael Kruse | 7886bd7 | 2016-09-08 15:02:36 | [diff] [blame] | 58 | Transform/FlattenSchedule.cpp |
59 | Transform/FlattenAlgo.cpp | ||||
Michael Kruse | 36e79ec | 2016-11-29 16:41:21 | [diff] [blame] | 60 | Transform/DeLICM.cpp |
Michael Kruse | ef3cf01 | 2015-09-11 09:01:55 | [diff] [blame] | 61 | ${POLLY_HEADER_FILES} |
Tobias Grosser | 7580537 | 2011-04-29 06:27:02 | [diff] [blame] | 62 | ) |
63 | |||||
Tobias Grosser | a041239 | 2016-07-13 15:54:47 | [diff] [blame] | 64 | if (GPU_CODEGEN) |
65 | target_link_libraries(Polly PollyPPCG) | ||||
66 | endif (GPU_CODEGEN) | ||||
67 | |||||
Michael Kruse | b280ded | 2015-09-24 12:38:49 | [diff] [blame] | 68 | target_link_libraries(Polly PollyISL) |
Michael Kruse | f228550 | 2015-06-22 20:31:16 | [diff] [blame] | 69 | |
Tobias Grosser | cf33c93 | 2015-02-12 08:27:19 | [diff] [blame] | 70 | if (BUILD_SHARED_LIBS) |
71 | target_link_libraries(Polly | ||||
72 | LLVMSupport | ||||
73 | LLVMCore | ||||
74 | LLVMScalarOpts | ||||
75 | LLVMInstCombine | ||||
76 | LLVMTransformUtils | ||||
77 | LLVMAnalysis | ||||
78 | LLVMipo | ||||
Tobias Grosser | ed61e1f | 2015-03-09 13:35:19 | [diff] [blame] | 79 | LLVMMC |
Tobias Grosser | ed873cd | 2016-01-31 20:25:46 | [diff] [blame] | 80 | # The libraries below are required for darwin: http://PR26392 |
81 | LLVMBitReader | ||||
82 | LLVMMCParser | ||||
83 | LLVMObject | ||||
84 | LLVMProfileData | ||||
85 | LLVMTarget | ||||
86 | LLVMVectorize | ||||
Tobias Grosser | cf33c93 | 2015-02-12 08:27:19 | [diff] [blame] | 87 | ) |
Tobias Grosser | 3027fed | 2015-03-04 18:51:27 | [diff] [blame] | 88 | link_directories( |
89 | ${LLVM_LIBRARY_DIR} | ||||
90 | ) | ||||
Tobias Grosser | bea6c54 | 2016-02-03 16:29:04 | [diff] [blame] | 91 | elseif (LLVM_LINK_LLVM_DYLIB) |
92 | target_link_libraries(Polly | ||||
93 | LLVM | ||||
94 | ) | ||||
95 | link_directories( | ||||
96 | ${LLVM_LIBRARY_DIR} | ||||
97 | ) | ||||
Tobias Grosser | cf33c93 | 2015-02-12 08:27:19 | [diff] [blame] | 98 | endif() |
99 | |||||
Sebastian Pop | ee605bc | 2014-03-13 22:07:17 | [diff] [blame] | 100 | # Build a monolithic Polly.a and a thin module LLVMPolly.moduleext that links to |
101 | # that static library. | ||||
Michael Kruse | c4ad882 | 2015-07-21 12:29:02 | [diff] [blame] | 102 | if (MSVC) |
103 | # Add dummy target, because loadable modules are not supported on Windows | ||||
104 | add_custom_target(LLVMPolly) | ||||
Michael Kruse | 6362f5a | 2015-07-21 12:40:01 | [diff] [blame] | 105 | set_target_properties(LLVMPolly PROPERTIES FOLDER "Polly") |
Michael Kruse | c4ad882 | 2015-07-21 12:29:02 | [diff] [blame] | 106 | else () |
107 | add_polly_loadable_module(LLVMPolly | ||||
108 | Polly.cpp | ||||
109 | ) | ||||
110 | |||||
111 | target_link_libraries(LLVMPolly Polly) | ||||
112 | |||||
113 | set_target_properties(LLVMPolly | ||||
114 | PROPERTIES | ||||
115 | LINKER_LANGUAGE CXX | ||||
116 | PREFIX "") | ||||
117 | endif () | ||||
Tobias Grosser | 23f16b1 | 2014-03-03 19:30:19 | [diff] [blame] | 118 | |
Tobias Grosser | ad41c4c | 2012-09-04 08:19:12 | [diff] [blame] | 119 | if (TARGET intrinsics_gen) |
120 | # Check if we are building as part of an LLVM build | ||||
Sebastian Pop | 96e9ed7 | 2014-03-13 20:29:19 | [diff] [blame] | 121 | add_dependencies(Polly intrinsics_gen) |
Tobias Grosser | ad41c4c | 2012-09-04 08:19:12 | [diff] [blame] | 122 | endif() |
123 |