Skip to content

Commit

Permalink
cmake: Set LINK_POLLY_INTO_TOOLS to ON (v2)
Browse files Browse the repository at this point in the history
This is the second try. This time we disable this feature if no Polly checkout
is available. For this to work we need to check if tools/polly is present
early enough that our decision is known before cmake generates Config/config.h.

With Polly checked into LLVM it was since a long time possible to compile
clang/opt/bugpoint with Polly support directly linked in, instead of only
providing Polly as a separate loadable module. This commit switches the
default from providing Polly as a module to linking Polly into tools, such
that it becomes unnecessary to load the Polly module when playing with Polly.
Such configuration has shown a lot more convenient for day-to-day Polly use.

This change does not impact the default behavior of any tool, if Polly is not
explicitly enabled when calling clang/opt/bugpoint Polly does not affect
compilation.

This change also does not impact normal LLVM/clang checkouts that do not
contain Polly.

Reviewers: jdoerfert, Meinersbur

Subscribers: pollydev, llvm-commits

Differential Revision: http://reviews.llvm.org/D19711

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268048 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
tobiasgrosser committed Apr 29, 2016
1 parent 432a665 commit a4c2f26
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
18 changes: 11 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ option(LLVM_USE_SPLIT_DWARF
"Use -gsplit-dwarf when compiling llvm." OFF)

option(WITH_POLLY "Build LLVM with Polly" ON)
option(LINK_POLLY_INTO_TOOLS "Static link Polly into tools" OFF)
option(LINK_POLLY_INTO_TOOLS "Static link Polly into tools" ON)

# Define an option controlling whether we should build for 32-bit on 64-bit
# platforms, where supported.
Expand Down Expand Up @@ -393,6 +393,16 @@ option (LLVM_ENABLE_SPHINX "Use Sphinx to generate llvm documentation." OFF)
option (LLVM_BUILD_EXTERNAL_COMPILER_RT
"Build compiler-rt as an external project." OFF)

if(WITH_POLLY)
if(NOT EXISTS ${LLVM_MAIN_SRC_DIR}/tools/polly/CMakeLists.txt)
set(WITH_POLLY OFF)
endif()
endif(WITH_POLLY)

if (NOT WITH_POLLY)
set(LINK_POLLY_INTO_TOOLS OFF)
endif (NOT WITH_POLLY)

# You can configure which libraries from LLVM you want to include in the
# shared library by setting LLVM_DYLIB_COMPONENTS to a semi-colon delimited
# list of LLVM components. All component names handled by llvm-config are valid.
Expand Down Expand Up @@ -702,12 +712,6 @@ endforeach()

add_subdirectory(projects)

if(WITH_POLLY)
if(NOT EXISTS ${LLVM_MAIN_SRC_DIR}/tools/polly/CMakeLists.txt)
set(WITH_POLLY OFF)
endif()
endif(WITH_POLLY)

if( LLVM_INCLUDE_TOOLS )
add_subdirectory(tools)
endif()
Expand Down
4 changes: 4 additions & 0 deletions tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ if(WITH_POLLY)
else()
set(LLVM_TOOL_POLLY_BUILD Off)
endif()
if(NOT LLVM_TOOL_POLL_BUILD)
MESSAGE(No polly)
endif()


if(NOT LLVM_BUILD_LLVM_DYLIB )
set(LLVM_TOOL_LLVM_SHLIB_BUILD Off)
Expand Down

0 comments on commit a4c2f26

Please sign in to comment.