# Configuration file for the 'lit' test runner.
import os
+import platform
import lit.formats
import lit.util
lit_config.load_config(config, site_cfg)
raise SystemExit
-# If necessary, point the dynamic loader at libLLVM.so.
-if config.enable_shared:
- shlibpath = config.environment.get(config.shlibpath_var,'')
- if shlibpath:
- shlibpath = os.pathsep + shlibpath
- shlibpath = config.shlibdir + shlibpath
- config.environment[config.shlibpath_var] = shlibpath
+shlibpath_var = ''
+if platform.system() == 'Linux':
+ shlibpath_var = 'LD_LIBRARY_PATH'
+elif platform.system() == 'Darwin':
+ shlibpath_var = 'DYLD_LIBRARY_PATH'
+elif platform.system() == 'Windows':
+ shlibpath_var = 'PATH'
+
+# Point the dynamic loader at dynamic libraries in 'lib'.
+llvm_libs_dir = getattr(config, 'llvm_libs_dir', None)
+if not llvm_libs_dir:
+ lit_config.fatal('No LLVM libs dir set!')
+shlibpath = os.path.pathsep.join((llvm_libs_dir,
+ config.environment.get(shlibpath_var,'')))
+config.environment[shlibpath_var] = shlibpath
+
config.clang_obj_root = "@CLANG_BINARY_DIR@"
config.enable_shared = @ENABLE_SHARED@
config.shlibdir = "@SHLIBDIR@"
-config.shlibpath_var = "@SHLIBPATH_VAR@"
config.target_triple = "@TARGET_TRIPLE@"
# Support substitution of the tools_dir, libs_dirs, and build_mode with user
unsigned options = PTUI->options;
CXTranslationUnit *out_TU = PTUI->out_TU;
+ // Set up the initial return values.
+ if (out_TU)
+ *out_TU = NULL;
+ PTUI->result = CXError_Failure;
+
// Check arguments.
if (!CIdx || !out_TU ||
(unsaved_files == NULL && num_unsaved_files != 0)) {
return;
}
- // Set up the initial return values.
- *out_TU = NULL;
- PTUI->result = CXError_Failure;
-
CIndexer *CXXIdx = static_cast<CIndexer *>(CIdx);
if (CXXIdx->isOptEnabled(CXGlobalOpt_ThreadBackgroundPriorityForIndexing))
CIdx, source_filename, command_line_args, num_command_line_args,
unsaved_files, num_unsaved_files, options, &TU);
(void)Result;
-
- // FIXME: This probably papers over a problem. If the result is not success,
- // no TU should be set.
- if (Result != CXError_Success)
- return 0;
-
+ assert((TU && Result == CXError_Success) ||
+ (!TU && Result != CXError_Success));
return TU;
}
add_subdirectory(Format)
add_subdirectory(Sema)
endif()
+if(NOT WIN32) # FIXME:Investigating.
+ add_subdirectory(libclang)
+endif()
IS_UNITTEST_LEVEL := 1
CLANG_LEVEL := ..
-PARALLEL_DIRS = Basic Lex Driver
+PARALLEL_DIRS = Basic Lex Driver libclang
include $(CLANG_LEVEL)/../..//Makefile.config