[polly] r202743 - cmake: build monolithic libLLVMPollyLib.dylib
Tobias Grosser
tobias at grosser.es
Mon Mar 3 11:30:19 PST 2014
Author: grosser
Date: Mon Mar 3 13:30:19 2014
New Revision: 202743
URL: http://llvm.org/viewvc/llvm-project?rev=202743&view=rev
Log:
cmake: build monolithic libLLVMPollyLib.dylib
The module LLVMPolly.so links to that. There is really no reason to build a
large number of mini-libraries here, especially as we do have dependences
between the libraries that are not properly handled and that make linking fail
on darwin.
Submitted-by: David Fang <fang at csl.cornell.edu>
Removed:
polly/trunk/lib/Analysis/CMakeLists.txt
polly/trunk/lib/CodeGen/CMakeLists.txt
polly/trunk/lib/Exchange/CMakeLists.txt
polly/trunk/lib/JSON/CMakeLists.txt
polly/trunk/lib/Support/CMakeLists.txt
Modified:
polly/trunk/cmake/polly_macros.cmake
polly/trunk/lib/CMakeLists.txt
Modified: polly/trunk/cmake/polly_macros.cmake
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/cmake/polly_macros.cmake?rev=202743&r1=202742&r2=202743&view=diff
==============================================================================
--- polly/trunk/cmake/polly_macros.cmake (original)
+++ polly/trunk/cmake/polly_macros.cmake Mon Mar 3 13:30:19 2014
@@ -58,7 +58,18 @@ endmacro(add_polly_library)
macro(add_polly_loadable_module name)
set(srcs ${ARGN})
+ # klduge: pass different values for MODULE with multiple targets in same dir
+ # this allows building shared-lib and module in same dir
+ # there must be a cleaner way to achieve this....
+ if (MODULE)
+ else()
+ set(GLOBAL_NOT_MODULE TRUE)
+ endif()
+ set(MODULE TRUE)
add_polly_library(${name} ${srcs})
+ if (GLOBAL_NOT_MODULE)
+ unset (MODULE)
+ endif()
if (APPLE)
# Darwin-specific linker flags for loadable modules.
set_target_properties(${name} PROPERTIES
Removed: polly/trunk/lib/Analysis/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/CMakeLists.txt?rev=202742&view=auto
==============================================================================
--- polly/trunk/lib/Analysis/CMakeLists.txt (original)
+++ polly/trunk/lib/Analysis/CMakeLists.txt (removed)
@@ -1,8 +0,0 @@
-add_polly_library(LLVMPollyAnalysis
- Dependences.cpp
- ScopDetection.cpp
- ScopInfo.cpp
- ScopGraphPrinter.cpp
- ScopPass.cpp
- TempScopInfo.cpp
-)
Modified: polly/trunk/lib/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CMakeLists.txt?rev=202743&r1=202742&r2=202743&view=diff
==============================================================================
--- polly/trunk/lib/CMakeLists.txt (original)
+++ polly/trunk/lib/CMakeLists.txt Mon Mar 3 13:30:19 2014
@@ -1,29 +1,66 @@
-add_subdirectory(Analysis)
-add_subdirectory(CodeGen)
-add_subdirectory(Exchange)
-add_subdirectory(Support)
-add_subdirectory(JSON)
+# build a monolithic libLLVMPollyLib.$shlibext
+# and a thin module LLVMPolly.moduleext that links to that shared library
-set(MODULE TRUE)
set(LLVM_NO_RTTI 1)
-if (SCOPLIB_FOUND)
- set(POLLY_SCOPLIB_FILES Pocc.cpp)
-endif (SCOPLIB_FOUND)
-
if (PLUTO_FOUND)
set(POLLY_PLUTO_FILES Pluto.cpp)
endif (PLUTO_FOUND)
-set(LLVM_USED_LIBS
- LLVMPollyAnalysis
- LLVMPollyCodeGen
- LLVMPollyExchange
- LLVMPollySupport
- LLVMPollyJSON
- )
+set(POLLY_JSON_FILES
+ JSON/json_reader.cpp
+ JSON/json_value.cpp
+ JSON/json_writer.cpp
+)
+
+if (CLOOG_FOUND)
+ set(CLOOG_FILES
+ CodeGen/Cloog.cpp
+ CodeGen/CodeGeneration.cpp)
+endif (CLOOG_FOUND)
+
+set(ISL_CODEGEN_FILES
+ CodeGen/IslAst.cpp
+ CodeGen/IslCodeGeneration.cpp)
+
+if (GPU_CODEGEN)
+ set (GPGPU_CODEGEN_FILES
+ CodeGen/PTXGenerator.cpp)
+endif (GPU_CODEGEN)
+
+if (OPENSCOP_FOUND)
+ set(POLLY_OPENSCOP_FILES
+ Exchange/OpenScopImporter.cpp
+ Exchange/OpenScopExporter.cpp)
+endif (OPENSCOP_FOUND)
+
+if (SCOPLIB_FOUND)
+ set(POLLY_SCOPLIB_FILES
+ Pocc.cpp
+ Exchange/ScopLib.cpp
+ Exchange/ScopLibExporter.cpp
+ Exchange/ScopLibImporter.cpp)
+endif (SCOPLIB_FOUND)
-add_polly_loadable_module(LLVMPolly
+add_polly_library(LLVMPollyLib
+ Analysis/Dependences.cpp
+ Analysis/ScopDetection.cpp
+ Analysis/ScopInfo.cpp
+ Analysis/ScopGraphPrinter.cpp
+ Analysis/ScopPass.cpp
+ Analysis/TempScopInfo.cpp
+ CodeGen/BlockGenerators.cpp
+ ${CLOOG_FILES}
+ ${ISL_CODEGEN_FILES}
+ CodeGen/LoopGenerators.cpp
+ CodeGen/Utils.cpp
+ ${GPGPU_CODEGEN_FILES}
+ Support/GICHelper.cpp
+ Support/SCEVValidator.cpp
+ Support/ScopHelper.cpp
+ Exchange/JSONExporter.cpp
+ ${POLLY_JSON_FILES}
+ ${POLLY_OPENSCOP_FILES}
Canonicalization.cpp
CodePreparation.cpp
DeadCodeElimination.cpp
@@ -36,18 +73,21 @@ add_polly_loadable_module(LLVMPolly
${POLLY_PLUTO_FILES}
)
+target_link_libraries(LLVMPollyLib
+ LLVMSupport
+ LLVMScalarOpts
+ LLVMTransformUtils
+ LLVMipo
+)
+
+add_polly_loadable_module(LLVMPolly)
+
if (TARGET intrinsics_gen)
# Check if we are building as part of an LLVM build
add_dependencies(LLVMPolly intrinsics_gen)
endif()
-add_dependencies(LLVMPolly
- LLVMPollyAnalysis
- LLVMPollyCodeGen
- LLVMPollyExchange
- LLVMPollySupport
- LLVMPollyJSON
- )
+target_link_libraries(LLVMPolly LLVMPollyLib)
set_target_properties(LLVMPolly
PROPERTIES
Removed: polly/trunk/lib/CodeGen/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/CMakeLists.txt?rev=202742&view=auto
==============================================================================
--- polly/trunk/lib/CodeGen/CMakeLists.txt (original)
+++ polly/trunk/lib/CodeGen/CMakeLists.txt (removed)
@@ -1,23 +0,0 @@
-if (CLOOG_FOUND)
- set(CLOOG_FILES
- Cloog.cpp
- CodeGeneration.cpp)
-endif (CLOOG_FOUND)
-
-set(ISL_CODEGEN_FILES
- IslAst.cpp
- IslCodeGeneration.cpp)
-
-if (GPU_CODEGEN)
- set (GPGPU_CODEGEN_FILES
- PTXGenerator.cpp)
-endif (GPU_CODEGEN)
-
-add_polly_library(LLVMPollyCodeGen
- BlockGenerators.cpp
- ${CLOOG_FILES}
- ${ISL_CODEGEN_FILES}
- LoopGenerators.cpp
- Utils.cpp
- ${GPGPU_CODEGEN_FILES}
-)
Removed: polly/trunk/lib/Exchange/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Exchange/CMakeLists.txt?rev=202742&view=auto
==============================================================================
--- polly/trunk/lib/Exchange/CMakeLists.txt (original)
+++ polly/trunk/lib/Exchange/CMakeLists.txt (removed)
@@ -1,20 +0,0 @@
-if (OPENSCOP_FOUND)
- set(POLLY_OPENSCOP_FILES
- OpenScopImporter.cpp
- OpenScopExporter.cpp)
-endif (OPENSCOP_FOUND)
-
-if (SCOPLIB_FOUND)
- set(POLLY_SCOPLIB_FILES
- ScopLib.cpp
- ScopLibExporter.cpp
- ScopLibImporter.cpp)
-endif (SCOPLIB_FOUND)
-
-add_polly_library(LLVMPollyExchange
- JSONExporter.cpp
- ${POLLY_OPENSCOP_FILES}
- ${POLLY_SCOPLIB_FILES}
-)
-
-target_link_libraries(LLVMPollyExchange LLVMPollyJSON)
Removed: polly/trunk/lib/JSON/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/JSON/CMakeLists.txt?rev=202742&view=auto
==============================================================================
--- polly/trunk/lib/JSON/CMakeLists.txt (original)
+++ polly/trunk/lib/JSON/CMakeLists.txt (removed)
@@ -1,6 +0,0 @@
-add_polly_library(LLVMPollyJSON
- json_reader.cpp
- json_value.cpp
- json_writer.cpp
-)
-
Removed: polly/trunk/lib/Support/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Support/CMakeLists.txt?rev=202742&view=auto
==============================================================================
--- polly/trunk/lib/Support/CMakeLists.txt (original)
+++ polly/trunk/lib/Support/CMakeLists.txt (removed)
@@ -1,5 +0,0 @@
-add_polly_library(LLVMPollySupport
- GICHelper.cpp
- SCEVValidator.cpp
- ScopHelper.cpp
- )
More information about the llvm-commits
mailing list