[Cmake] Optionally use a system isl version.

This patch adds an option to build against a version of libisl already
installed on the system. The installation is autodetected using the
pkg-config file shipped with isl.

The detection of the library is in the FindISL.cmake module that creates
an imported target.

Contributed-by: Philip Pfaffe <philip.pfaffe@gmail.com>

Differential Revision: https://reviews.llvm.org/D30043

llvm-svn: 296361
This commit is contained in:
Michael Kruse 2017-02-27 17:54:25 +00:00
parent 47e7d7fe85
commit 6469380daa
5 changed files with 212 additions and 162 deletions

View File

@ -158,12 +158,24 @@ if (CUDALIB_FOUND)
INCLUDE_DIRECTORIES( ${CUDALIB_INCLUDE_DIR} ) INCLUDE_DIRECTORIES( ${CUDALIB_INCLUDE_DIR} )
endif(CUDALIB_FOUND) endif(CUDALIB_FOUND)
option(POLLY_BUNDLED_ISL "Use the bundled version of libisl included in Polly" ON)
if (NOT POLLY_BUNDLED_ISL)
find_package(ISL MODULE REQUIRED)
message(STATUS "Using external libisl ${ISL_VERSION} in: ${ISL_PREFIX}")
set(ISL_TARGET ISL)
else()
set(ISL_INCLUDE_DIRS
${CMAKE_CURRENT_BINARY_DIR}/lib/External/isl/include
${CMAKE_CURRENT_SOURCE_DIR}/lib/External/isl/include
)
set(ISL_TARGET PollyISL)
endif()
include_directories( include_directories(
BEFORE BEFORE
${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/include
${ISL_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}/lib/External/JSON/include ${CMAKE_CURRENT_SOURCE_DIR}/lib/External/JSON/include
${CMAKE_CURRENT_BINARY_DIR}/lib/External/isl/include
${CMAKE_CURRENT_SOURCE_DIR}/lib/External/isl/include
${CMAKE_CURRENT_SOURCE_DIR}/lib/External/pet/include ${CMAKE_CURRENT_SOURCE_DIR}/lib/External/pet/include
${CMAKE_CURRENT_SOURCE_DIR}/lib/External ${CMAKE_CURRENT_SOURCE_DIR}/lib/External
${CMAKE_CURRENT_BINARY_DIR}/include ${CMAKE_CURRENT_BINARY_DIR}/include

24
polly/cmake/FindISL.cmake Normal file
View File

@ -0,0 +1,24 @@
find_package(PkgConfig REQUIRED)
pkg_search_module(ISL isl)
if (NOT ISL_FOUND EQUAL 1)
message(FATAL_ERROR "No libisl found on this system. Consider setting PKG_CONFIG_PATH.")
endif()
add_library(ISL INTERFACE IMPORTED)
foreach (incl IN LISTS ISL_INCLUDE_DIRS)
set_property(TARGET ISL APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${incl})
endforeach()
foreach (libname IN LISTS ISL_LIBRARIES)
if (ISL_LIBRARY_DIRS)
foreach (dir IN LISTS ISL_LIBRARY_DIRS)
list(APPEND hints ${dir})
endforeach()
endif()
find_library(lib NAMES ${libname} HINTS ${hints} NO_DEFAULT_PATH)
set_property(TARGET ISL APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${lib})
endforeach()
foreach (opt IN LISTS ISL_CFLAGS ISL_CFLAGS_OTHER)
set_property(TARGET ISL APPEND PROPERTY INTERFACE_COMPILE_OPTIONS ${opt})
endforeach()

View File

@ -66,7 +66,7 @@ if (GPU_CODEGEN)
target_link_libraries(Polly PollyPPCG) target_link_libraries(Polly PollyPPCG)
endif (GPU_CODEGEN) endif (GPU_CODEGEN)
target_link_libraries(Polly PollyISL) target_link_libraries(Polly ${ISL_TARGET})
if (BUILD_SHARED_LIBS) if (BUILD_SHARED_LIBS)
target_link_libraries(Polly target_link_libraries(Polly

View File

@ -1,181 +1,182 @@
# External: Integer Set Library # External: Integer Set Library
set(ISL_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/isl") if (POLLY_BUNDLED_ISL)
set(ISL_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/isl") set(ISL_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/isl")
set(ISL_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/isl")
# Determine version of isl # Determine version of isl
if (EXISTS "${ISL_SOURCE_DIR}/GIT_HEAD_ID") if (EXISTS "${ISL_SOURCE_DIR}/GIT_HEAD_ID")
# The source comes from a 'make dist' archive # The source comes from a 'make dist' archive
file(READ "${ISL_SOURCE_DIR}/GIT_HEAD_ID" ISL_GIT_HEAD_ID) file(READ "${ISL_SOURCE_DIR}/GIT_HEAD_ID" ISL_GIT_HEAD_ID)
string(STRIP "${ISL_GIT_HEAD_ID}" ISL_GIT_HEAD_ID) string(STRIP "${ISL_GIT_HEAD_ID}" ISL_GIT_HEAD_ID)
elseif (EXISTS "${ISL_SOURCE_DIR}/gitversion.h") elseif (EXISTS "${ISL_SOURCE_DIR}/gitversion.h")
# The source directory is preconfigured # The source directory is preconfigured
file(READ "${ISL_SOURCE_DIR}/gitversion.h" GITVERSION_H) file(READ "${ISL_SOURCE_DIR}/gitversion.h" GITVERSION_H)
string(REGEX REPLACE ".*\\\"([^\\\"]*)\\\".*" "\\1" ISL_GIT_HEAD_ID "${GITVERSION_H}") string(REGEX REPLACE ".*\\\"([^\\\"]*)\\\".*" "\\1" ISL_GIT_HEAD_ID "${GITVERSION_H}")
elseif () elseif ()
# Unknown revision # Unknown revision
# TODO: We could look for a .git and get the revision from HEAD # TODO: We could look for a .git and get the revision from HEAD
set(ISL_GIT_HEAD_ID "UNKNOWN") set(ISL_GIT_HEAD_ID "UNKNOWN")
endif ()
message(STATUS "ISL version: ${ISL_GIT_HEAD_ID}")
# Enable small integer optimization and imath
set(USE_GMP_FOR_MP OFF)
set(USE_IMATH_FOR_MP ON)
set(USE_SMALL_INT_OPT ON)
# Determine compiler characteristics
include(CheckCSourceCompiles)
# Like check_c_source_compiles, but sets the result to either
# 0 (error while compiling) or 1 (compiled successfully)
# Required for compatibility with autotool's AC_CHECK_DECLS
function (check_c_source_compiles_numeric _prog _var)
check_c_source_compiles("${_prog}" "${_var}")
if ("${${_var}}")
set("${_var}" 1 PARENT_SCOPE)
else ()
set("${_var}" 0 PARENT_SCOPE)
endif () endif ()
endfunction ()
# Check for the existance of a type message(STATUS "ISL version: ${ISL_GIT_HEAD_ID}")
function (check_c_type_exists _type _files _variable)
set(_includes "") # Enable small integer optimization and imath
foreach (file_name ${_files}) set(USE_GMP_FOR_MP OFF)
set(_includes "${_includes}#include<${file_name}>\n") set(USE_IMATH_FOR_MP ON)
endforeach() set(USE_SMALL_INT_OPT ON)
check_c_source_compiles("
# Determine compiler characteristics
include(CheckCSourceCompiles)
# Like check_c_source_compiles, but sets the result to either
# 0 (error while compiling) or 1 (compiled successfully)
# Required for compatibility with autotool's AC_CHECK_DECLS
function (check_c_source_compiles_numeric _prog _var)
check_c_source_compiles("${_prog}" "${_var}")
if ("${${_var}}")
set("${_var}" 1 PARENT_SCOPE)
else ()
set("${_var}" 0 PARENT_SCOPE)
endif ()
endfunction ()
# Check for the existance of a type
function (check_c_type_exists _type _files _variable)
set(_includes "")
foreach (file_name ${_files})
set(_includes "${_includes}#include<${file_name}>\n")
endforeach()
check_c_source_compiles("
${_includes} ${_includes}
${_type} typeVar; ${_type} typeVar;
int main() { int main() {
return 0; return 0;
} }
" ${_variable}) " ${_variable})
endfunction () endfunction ()
check_c_source_compiles(" check_c_source_compiles("
int func(void) __attribute__((__warn_unused_result__)); int func(void) __attribute__((__warn_unused_result__));
int main() { return 0; } int main() { return 0; }
" HAS_ATTRIBUTE_WARN_UNUSED_RESULT) " HAS_ATTRIBUTE_WARN_UNUSED_RESULT)
set(GCC_WARN_UNUSED_RESULT) set(GCC_WARN_UNUSED_RESULT)
if (HAS_ATTRIBUTE_WARN_UNUSED_RESULT) if (HAS_ATTRIBUTE_WARN_UNUSED_RESULT)
set(GCC_WARN_UNUSED_RESULT "__attribute__((__warn_unused_result__))") set(GCC_WARN_UNUSED_RESULT "__attribute__((__warn_unused_result__))")
endif () endif ()
check_c_source_compiles(" check_c_source_compiles("
__attribute__ ((unused)) static void foo(void); __attribute__ ((unused)) static void foo(void);
int main() { return 0; } int main() { return 0; }
" HAVE___ATTRIBUTE__) " HAVE___ATTRIBUTE__)
check_c_source_compiles_numeric(" check_c_source_compiles_numeric("
#include <strings.h> #include <strings.h>
int main() { (void)ffs(0); return 0; } int main() { (void)ffs(0); return 0; }
" HAVE_DECL_FFS) " HAVE_DECL_FFS)
check_c_source_compiles_numeric(" check_c_source_compiles_numeric("
int main() { (void)__builtin_ffs(0); return 0; } int main() { (void)__builtin_ffs(0); return 0; }
" HAVE_DECL___BUILTIN_FFS) " HAVE_DECL___BUILTIN_FFS)
check_c_source_compiles_numeric(" check_c_source_compiles_numeric("
#include <intrin.h> #include <intrin.h>
int main() { (void)_BitScanForward(NULL, 0); return 0; } int main() { (void)_BitScanForward(NULL, 0); return 0; }
" HAVE_DECL__BITSCANFORWARD) " HAVE_DECL__BITSCANFORWARD)
if (NOT HAVE_DECL_FFS AND if (NOT HAVE_DECL_FFS AND
NOT HAVE_DECL___BUILTIN_FFS AND NOT HAVE_DECL___BUILTIN_FFS AND
NOT HAVE_DECL__BITSCANFORWARD) NOT HAVE_DECL__BITSCANFORWARD)
message(FATAL_ERROR "No ffs implementation found") message(FATAL_ERROR "No ffs implementation found")
endif () endif ()
check_c_source_compiles_numeric(" check_c_source_compiles_numeric("
#include <strings.h> #include <strings.h>
int main() { (void)strcasecmp(\"\", \"\"); return 0; } int main() { (void)strcasecmp(\"\", \"\"); return 0; }
" HAVE_DECL_STRCASECMP) " HAVE_DECL_STRCASECMP)
check_c_source_compiles_numeric(" check_c_source_compiles_numeric("
#include <string.h> #include <string.h>
int main() { (void)_stricmp(\"\", \"\"); return 0; } int main() { (void)_stricmp(\"\", \"\"); return 0; }
" HAVE_DECL__STRICMP) " HAVE_DECL__STRICMP)
if (NOT HAVE_DECL_STRCASECMP AND NOT HAVE_DECL__STRICMP) if (NOT HAVE_DECL_STRCASECMP AND NOT HAVE_DECL__STRICMP)
message(FATAL_ERROR "No strcasecmp implementation found") message(FATAL_ERROR "No strcasecmp implementation found")
endif () endif ()
check_c_source_compiles_numeric(" check_c_source_compiles_numeric("
#include <strings.h> #include <strings.h>
int main() { (void)strncasecmp(\"\", \"\", 0); return 0; } int main() { (void)strncasecmp(\"\", \"\", 0); return 0; }
" HAVE_DECL_STRNCASECMP) " HAVE_DECL_STRNCASECMP)
check_c_source_compiles_numeric(" check_c_source_compiles_numeric("
#include <string.h> #include <string.h>
int main() { (void)_strnicmp(\"\", \"\", 0); return 0; } int main() { (void)_strnicmp(\"\", \"\", 0); return 0; }
" HAVE_DECL__STRNICMP) " HAVE_DECL__STRNICMP)
if (NOT HAVE_DECL_STRNCASECMP AND NOT HAVE_DECL__STRNICMP) if (NOT HAVE_DECL_STRNCASECMP AND NOT HAVE_DECL__STRNICMP)
message(FATAL_ERROR "No strncasecmp implementation found") message(FATAL_ERROR "No strncasecmp implementation found")
endif () endif ()
check_c_source_compiles_numeric(" check_c_source_compiles_numeric("
#include <stdio.h> #include <stdio.h>
int main() { snprintf((void*)0, 0, \" \"); return 0; } int main() { snprintf((void*)0, 0, \" \"); return 0; }
" HAVE_DECL_SNPRINTF) " HAVE_DECL_SNPRINTF)
check_c_source_compiles_numeric(" check_c_source_compiles_numeric("
#include <stdio.h> #include <stdio.h>
int main() { _snprintf((void*)0, 0, \" \"); return 0; } int main() { _snprintf((void*)0, 0, \" \"); return 0; }
" HAVE_DECL__SNPRINTF) " HAVE_DECL__SNPRINTF)
if (NOT HAVE_DECL_SNPRINTF AND NOT HAVE_DECL__SNPRINTF) if (NOT HAVE_DECL_SNPRINTF AND NOT HAVE_DECL__SNPRINTF)
message(FATAL_ERROR "No snprintf implementation found") message(FATAL_ERROR "No snprintf implementation found")
endif () endif ()
check_c_type_exists(uint8_t "" HAVE_UINT8T) check_c_type_exists(uint8_t "" HAVE_UINT8T)
check_c_type_exists(uint8_t "stdint.h" HAVE_STDINT_H) check_c_type_exists(uint8_t "stdint.h" HAVE_STDINT_H)
check_c_type_exists(uint8_t "inttypes.h" HAVE_INTTYPES_H) check_c_type_exists(uint8_t "inttypes.h" HAVE_INTTYPES_H)
check_c_type_exists(uint8_t "sys/types.h" HAVE_SYS_INTTYPES_H) check_c_type_exists(uint8_t "sys/types.h" HAVE_SYS_INTTYPES_H)
if (HAVE_UINT8T) if (HAVE_UINT8T)
set(INCLUDE_STDINT_H "") set(INCLUDE_STDINT_H "")
elseif (HAVE_STDINT_H) elseif (HAVE_STDINT_H)
set(INCLUDE_STDINT_H "#include <stdint.h>") set(INCLUDE_STDINT_H "#include <stdint.h>")
elseif (HAVE_INTTYPES_H) elseif (HAVE_INTTYPES_H)
set(INCLUDE_STDINT_H "#include <inttypes.h>") set(INCLUDE_STDINT_H "#include <inttypes.h>")
elseif (HAVE_SYS_INTTYPES_H) elseif (HAVE_SYS_INTTYPES_H)
set(INCLUDE_STDINT_H "#include <sys/inttypes.h>") set(INCLUDE_STDINT_H "#include <sys/inttypes.h>")
else () else ()
message(FATAL_ERROR "No stdint.h or compatible found") message(FATAL_ERROR "No stdint.h or compatible found")
endif () endif ()
# Write configure result # Write configure result
# configure_file(... COPYONLY) avoids that the time stamp changes if the file is identical # configure_file(... COPYONLY) avoids that the time stamp changes if the file is identical
file(WRITE "${ISL_BINARY_DIR}/gitversion.h.tmp" file(WRITE "${ISL_BINARY_DIR}/gitversion.h.tmp"
"#define GIT_HEAD_ID \"${ISL_GIT_HEAD_ID}\"") "#define GIT_HEAD_ID \"${ISL_GIT_HEAD_ID}\"")
configure_file("${ISL_BINARY_DIR}/gitversion.h.tmp" configure_file("${ISL_BINARY_DIR}/gitversion.h.tmp"
"${ISL_BINARY_DIR}/gitversion.h" COPYONLY) "${ISL_BINARY_DIR}/gitversion.h" COPYONLY)
file(WRITE "${ISL_BINARY_DIR}/include/isl/stdint.h.tmp" file(WRITE "${ISL_BINARY_DIR}/include/isl/stdint.h.tmp"
"${INCLUDE_STDINT_H}\n") "${INCLUDE_STDINT_H}\n")
configure_file("${ISL_BINARY_DIR}/include/isl/stdint.h.tmp" configure_file("${ISL_BINARY_DIR}/include/isl/stdint.h.tmp"
"${ISL_BINARY_DIR}/include/isl/stdint.h" COPYONLY) "${ISL_BINARY_DIR}/include/isl/stdint.h" COPYONLY)
configure_file("isl_config.h.cmake" "${ISL_BINARY_DIR}/isl_config.h") configure_file("isl_config.h.cmake" "${ISL_BINARY_DIR}/isl_config.h")
configure_file("isl_srcdir.c.cmake" "${ISL_BINARY_DIR}/isl_srcdir.c") configure_file("isl_srcdir.c.cmake" "${ISL_BINARY_DIR}/isl_srcdir.c")
include_directories(BEFORE include_directories(BEFORE
${ISL_BINARY_DIR} ${ISL_BINARY_DIR}
${ISL_SOURCE_DIR}/imath ${ISL_SOURCE_DIR}/imath
${ISL_SOURCE_DIR}/include ${ISL_SOURCE_DIR}/include
${ISL_SOURCE_DIR} ${ISL_SOURCE_DIR}
) )
# ISL files to compile # ISL files to compile
set (ISL_FILES set (ISL_FILES
isl/basis_reduction_tab.c isl/basis_reduction_tab.c
isl/isl_aff.c isl/isl_aff.c
isl/isl_affine_hull.c isl/isl_affine_hull.c
@ -258,36 +259,36 @@ set (ISL_FILES
isl/imath/imrat.c isl/imath/imrat.c
) )
add_polly_library(PollyISL add_polly_library(PollyISL
${ISL_FILES} ${ISL_FILES}
)
# TODO: optionally use system isl instead
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
install(DIRECTORY
${ISL_SOURCE_DIR}/include/
${ISL_BINARY_DIR}/include/
DESTINATION include/polly
FILES_MATCHING
PATTERN "*.h"
PATTERN "CMakeFiles" EXCLUDE
PATTERN ".svn" EXCLUDE
) )
endif()
add_executable(polly-isl-test
isl/isl_test.c
)
set_target_properties(polly-isl-test PROPERTIES FOLDER "Polly")
target_link_libraries(polly-isl-test if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
PollyISL install(DIRECTORY
) ${ISL_SOURCE_DIR}/include/
${ISL_BINARY_DIR}/include/
DESTINATION include/polly
FILES_MATCHING
PATTERN "*.h"
PATTERN "CMakeFiles" EXCLUDE
PATTERN ".svn" EXCLUDE
)
endif()
# ISL requires at least C99 to compile. gcc < 5.0 use -std=gnu89 as default. add_executable(polly-isl-test
target_enable_c99(PollyISL) isl/isl_test.c
target_enable_c99(polly-isl-test) )
set_target_properties(polly-isl-test PROPERTIES FOLDER "Polly")
target_link_libraries(polly-isl-test
PollyISL
)
# ISL requires at least C99 to compile. gcc < 5.0 use -std=gnu89 as default.
target_enable_c99(PollyISL)
target_enable_c99(polly-isl-test)
endif (POLLY_BUNDLED_ISL)
set(PET_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/pet") set(PET_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/pet")
set(PPCG_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ppcg") set(PPCG_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ppcg")
@ -335,7 +336,7 @@ add_polly_library(PollyPPCG
${PPCG_FILES} ${PPCG_FILES}
) )
target_link_libraries(PollyPPCG PollyISL) target_link_libraries(PollyPPCG ${ISL_TARGET})
# Disable warnings for upstream projects. # Disable warnings for upstream projects.
if (MSVC) if (MSVC)
@ -346,13 +347,16 @@ if (MSVC)
-wd4201 # nonstandard extension used: nameless struct/union -wd4201 # nonstandard extension used: nameless struct/union
-wd4334 # 'operator': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) -wd4334 # 'operator': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)
) )
target_compile_options(PollyISL PRIVATE ${DISABLE_WARNING_FLAGS}) if (POLLY_BUNDLED_ISL)
target_compile_options(polly-isl-test PRIVATE ${DISABLE_WARNING_FLAGS}) target_compile_options(PollyISL PRIVATE ${DISABLE_WARNING_FLAGS})
target_compile_options(polly-isl-test PRIVATE ${DISABLE_WARNING_FLAGS})
endif (POLLY_BUNDLED_ISL)
target_compile_options(PollyPPCG PRIVATE ${DISABLE_WARNING_FLAGS}) target_compile_options(PollyPPCG PRIVATE ${DISABLE_WARNING_FLAGS})
else () else ()
set_target_properties(PollyISL polly-isl-test PollyPPCG PROPERTIES if (POLLY_BUNDLED_ISL)
COMPILE_FLAGS "-w" set_target_properties(PollyISL polly-isl-test PROPERTIES COMPILE_FLAGS "-w")
) endif (POLLY_BUNDLED_ISL)
set_target_properties(PollyPPCG PROPERTIES COMPILE_FLAGS "-w")
endif () endif ()
if(MSVC) if(MSVC)

View File

@ -20,7 +20,9 @@ if (NOT DEFINED LLVM_MAIN_SRC_DIR)
# We are building polly out of tree, adjust the settings. # We are building polly out of tree, adjust the settings.
# FIXME: FileCheck is not available in llvm install directory at the moment. # FIXME: FileCheck is not available in llvm install directory at the moment.
set(LLVM_LIT ${LLVM_INSTALL_ROOT}/bin/llvm-lit) set(LLVM_LIT ${LLVM_INSTALL_ROOT}/bin/llvm-lit)
set(POLLY_TEST_DEPS LLVMPolly polly-isl-test) if (POLLY_BUNDLED_ISL)
set(POLLY_TEST_DEPS LLVMPolly polly-isl-test)
endif (POLLY_BUNDLED_ISL)
if (POLLY_GTEST_AVAIL) if (POLLY_GTEST_AVAIL)
list(APPEND POLLY_TEST_DEPS PollyUnitTests) list(APPEND POLLY_TEST_DEPS PollyUnitTests)
endif () endif ()
@ -101,21 +103,27 @@ if (NOT DEFINED LLVM_MAIN_SRC_DIR)
${CMAKE_CURRENT_SOURCE_DIR}/UnitIsl/lit.site.cfg.in ${CMAKE_CURRENT_SOURCE_DIR}/UnitIsl/lit.site.cfg.in
${CMAKE_CURRENT_BINARY_DIR}/UnitIsl/lit.site.cfg) ${CMAKE_CURRENT_BINARY_DIR}/UnitIsl/lit.site.cfg)
add_custom_target(check-polly-isl
command ${LLVM_LIT} if (POLLY_BUNDLED_ISL)
--param polly_site_config=${CMAKE_CURRENT_BINARY_DIR}/UnitIsl/lit.site.cfg add_custom_target(check-polly-isl
--param build_config=${CMAKE_CFG_INTDIR} command ${LLVM_LIT}
-sv ${POLLY_TEST_EXTRA_ARGS} --param polly_site_config=${CMAKE_CURRENT_BINARY_DIR}/UnitIsl/lit.site.cfg
${CMAKE_CURRENT_BINARY_DIR} --param build_config=${CMAKE_CFG_INTDIR}
DEPENDS polly-isl-test -sv ${POLLY_TEST_EXTRA_ARGS}
COMMENT "Running isl unit tests") ${CMAKE_CURRENT_BINARY_DIR}
set_target_properties(check-polly-isl PROPERTIES FOLDER "Polly") DEPENDS polly-isl-test
COMMENT "Running isl unit tests")
set_target_properties(check-polly-isl PROPERTIES FOLDER "Polly")
endif (POLLY_BUNDLED_ISL)
endif() endif()
else (NOT DEFINED LLVM_MAIN_SRC_DIR) else (NOT DEFINED LLVM_MAIN_SRC_DIR)
set(LLVM_LIT ${LLVM_TOOLS_BINARY_DIR}/llvm-lit) set(LLVM_LIT ${LLVM_TOOLS_BINARY_DIR}/llvm-lit)
set(POLLY_TEST_DEPS llvm-config opt LLVMPolly FileCheck not polly-isl-test) set(POLLY_TEST_DEPS llvm-config opt LLVMPolly FileCheck not)
if (POLLY_BUNDLED_ISL)
list(APPEND POLLY_TEST_DEPS polly-isl-test)
endif()
if (POLLY_GTEST_AVAIL) if (POLLY_GTEST_AVAIL)
list(APPEND POLLY_TEST_DEPS PollyUnitTests) list(APPEND POLLY_TEST_DEPS PollyUnitTests)
endif () endif ()
@ -158,12 +166,14 @@ else (NOT DEFINED LLVM_MAIN_SRC_DIR)
${CMAKE_CURRENT_SOURCE_DIR}/UnitIsl/lit.site.cfg.in ${CMAKE_CURRENT_SOURCE_DIR}/UnitIsl/lit.site.cfg.in
${CMAKE_CURRENT_BINARY_DIR}/UnitIsl/lit.site.cfg) ${CMAKE_CURRENT_BINARY_DIR}/UnitIsl/lit.site.cfg)
add_lit_testsuite(check-polly-isl "Running isl unit tests only" if (POLLY_BUNDLED_ISL)
${CMAKE_CURRENT_BINARY_DIR}/UnitIsl add_lit_testsuite(check-polly-isl "Running isl unit tests only"
PARAMS polly_site_config=${CMAKE_CURRENT_BINARY_DIR}/UnitIsl/lit.site.cfg ${CMAKE_CURRENT_BINARY_DIR}/UnitIsl
DEPENDS polly-isl-test PARAMS polly_site_config=${CMAKE_CURRENT_BINARY_DIR}/UnitIsl/lit.site.cfg
) DEPENDS polly-isl-test
set_target_properties(check-polly-isl PROPERTIES FOLDER "Polly") )
set_target_properties(check-polly-isl PROPERTIES FOLDER "Polly")
endif (POLLY_BUNDLED_ISL)
# Run polly-check-format as part of polly-check only if we are compiling with # Run polly-check-format as part of polly-check only if we are compiling with
# clang, so clang-format is available. # clang, so clang-format is available.