Page MenuHomePhabricator

[Polly] Really fix Windows builds.
Needs ReviewPublic

Authored by DiamondLovesYou on Sep 11 2018, 6:43 PM.



Cleanup and refactor the lib/ CMake script to utilize modern LLVM CMake features. Moved lib/Polly.cpp to lib/Polly/Polly.cpp to satisfy LLVM CMake checks.

Combined with a forthcoming patch to LLVM and LLVM_LINK_LLVM_DYLIB, allows building LLVMPolly on Windows.

Event Timeline

Does this fix the Windows or "non-MSVC" builds (as D51904)? For which configurations?

The patch moves some code around. Could you detail what you did and why?
(I intend to test all/most configurations before accepting)

DiamondLovesYou edited the summary of this revision. (Show Details)Sep 13 2018, 10:26 AM

Update the unit tests to work with the changes in this patch and the changes from upstream.

Currently, when I apply this, I get the following error (Windows and Linux):

CMake Error at cmake/modules/LLVM-Config.cmake:105 (target_link_libraries):
  Target "LLVMPolly" of type MODULE_LIBRARY may not be linked into another
  target.  One may link only to STATIC or SHARED libraries, or to executables
  with the ENABLE_EXPORTS property set.
Call Stack (most recent call first):
  cmake/modules/LLVM-Config.cmake:93 (explicit_llvm_config)
  cmake/modules/AddLLVM.cmake:774 (llvm_config)
  cmake/modules/AddLLVM.cmake:1108 (add_llvm_executable)
  tools/polly/unittests/CMakeLists.txt:9 (add_unittest)
  tools/polly/unittests/Isl/CMakeLists.txt:1 (add_polly_unittest)

Can you ping this review when the a forthcoming patch to LLVM has landed?

mati865 added a subscriber: mati865.Apr 8 2019, 3:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 8 2019, 3:14 AM

When applying this patch to the current trunk, I get:

CMake Error at tools/polly/lib/CMakeLists.txt:116 (add_llvm_loadable_module):
  Unknown CMake command "add_llvm_loadable_module".