# Make sure the isl c files are built as fPIC
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
+
+ # Set directory for polly-isl-test.
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin")
else ()
set(LLVM_SOURCE_ROOT "${LLVM_MAIN_SRC_DIR}")
set(POLLY_GTEST_AVAIL 1)
config.llvm_src_root = getattr(config, 'llvm_src_root', None)
config.llvm_obj_root = getattr(config, 'llvm_obj_root', None)
-# Tweak the PATH to include the tools dir and the scripts dir.
-if polly_obj_root is not None:
- llvm_tools_dir = getattr(config, 'llvm_tools_dir', None)
- if not llvm_tools_dir:
- lit_config.fatal('No LLVM tools dir set!')
- path = os.path.pathsep.join((llvm_tools_dir, config.environment['PATH']))
- config.environment['PATH'] = path
+# Tweak the PATH to ensure that built files are the ones executed.
+bin_dir = getattr(config, 'bin_dir', None)
+if bin_dir is None:
+ lit_config.fatal('No executable dir set!')
+path = os.path.pathsep.join((bin_dir, config.environment['PATH']))
+config.environment['PATH'] = path
config.environment['srcdir'] = os.path.join(config.test_source_root,
'../../lib/External/isl')
config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
config.polly_obj_root = "@POLLY_BINARY_DIR@"
+config.bin_dir = "@CMAKE_RUNTIME_OUTPUT_DIRECTORY@"
# Let the main config do the real work.
lit_config.load_config(config, "@POLLY_SOURCE_DIR@/test/UnitIsl/lit.cfg")