// Clang Python Bindings
//===----------------------------------------------------------------------===//
-This directory implements Python bindings for Clang. Currently, only bindings
-for the CIndex C API exist.
+This directory implements Python bindings for Clang.
-You may need to alter LD_LIBRARY_PATH so that the CIndex library can be
+You may need to alter LD_LIBRARY_PATH so that the Clang library can be
found. The unit tests are designed to be run with 'nosetests'. For example:
--
$ env PYTHONPATH=$(echo ~/llvm/tools/clang/bindings/python/) \
import platform
name = platform.system()
if name == 'Darwin':
- return cdll.LoadLibrary('libCIndex.dylib')
+ return cdll.LoadLibrary('libclang.dylib')
elif name == 'Windows':
- return cdll.LoadLibrary('libCIndex.dll')
+ return cdll.LoadLibrary('libclang.dll')
else:
- return cdll.LoadLibrary('libCIndex.so')
+ return cdll.LoadLibrary('libclang.so')
# ctypes doesn't implicitly convert c_void_p to the appropriate wrapper
# object. This is a problem, because it means that from_parameter will see an
-add_subdirectory(CIndex)
+add_subdirectory(libclang)
add_subdirectory(c-index-test)
add_subdirectory(driver)
##===----------------------------------------------------------------------===##
LEVEL := ../../..
-DIRS := driver CIndex c-index-test
+DIRS := driver libclang c-index-test
include $(LEVEL)/Makefile.config
ifeq ($(OS), $(filter $(OS), Cygwin MingW))
-DIRS := $(filter-out CIndex c-index-test, $(DIRS))
+DIRS := $(filter-out libclang c-index-test, $(DIRS))
endif
include $(LEVEL)/Makefile.common
set(LLVM_NO_RTTI 1)
set( LLVM_USED_LIBS
- CIndex
+ libclang
clangIndex
clangFrontend
clangDriver
include $(LEVEL)/Makefile.config
LINK_COMPONENTS := bitreader mc core
-USEDLIBS = CIndex.a clangIndex.a clangFrontend.a clangDriver.a clangSema.a \
+USEDLIBS = clang.a clangIndex.a clangFrontend.a clangDriver.a clangSema.a \
clangAnalysis.a clangAST.a clangParse.a clangLex.a clangBasic.a
include $(LLVM_SRC_ROOT)/Makefile.rules
core
)
-add_clang_library(CIndex
+add_clang_library(libclang
CIndex.cpp
CIndexCodeCompletion.cpp
CIndexDiagnostic.cpp
CXCursor.cpp
../../include/clang-c/Index.h
)
+set_target_properties(libclang PROPERTIES OUTPUT_NAME clang)
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
# FIXME: Deal with LLVM_SUBMIT_VERSION?
# get underscore-prefixed names. It would be better to have build rules
# which know how to produce a darwin-suitable exports file from the
# regular exports file.
- set_target_properties(CIndex
+ set_target_properties(libclang
PROPERTIES
- LINK_FLAGS "-avoid-version -Wl,-exported_symbols_list -Wl,${CMAKE_CURRENT_SOURCE_DIR}/CIndex.darwin.exports -Wl,-dead_strip -Wl,-seg1addr -Wl,0xE0000000"
+ LINK_FLAGS "-avoid-version -Wl,-exported_symbols_list -Wl,${CMAKE_CURRENT_SOURCE_DIR}/libclang.darwin.exports -Wl,-dead_strip -Wl,-seg1addr -Wl,0xE0000000"
INSTALL_NAME_DIR "@executable_path/../lib"
)
endif()
# windows.h doesn't compile with /Za
get_target_property(NON_ANSI_COMPILE_FLAGS CIndex COMPILE_FLAGS)
string(REPLACE /Za "" NON_ANSI_COMPILE_FLAGS ${NON_ANSI_COMPILE_FLAGS})
- set_target_properties(CIndex PROPERTIES COMPILE_FLAGS ${NON_ANSI_COMPILE_FLAGS})
+ set_target_properties(libclang PROPERTIES COMPILE_FLAGS ${NON_ANSI_COMPILE_FLAGS})
endif(MSVC)
-set_target_properties(CIndex
+set_target_properties(libclang
PROPERTIES
LINKER_LANGUAGE CXX
DEFINE_SYMBOL _CINDEX_LIB_)
-##===- tools/CIndex/Makefile -------------------------------*- Makefile -*-===##
+##===- tools/libclang/Makefile -----------------------------*- Makefile -*-===##
#
# The LLVM Compiler Infrastructure
#
##===----------------------------------------------------------------------===##
LEVEL = ../../../..
-LIBRARYNAME = CIndex
+LIBRARYNAME = clang
-EXPORTED_SYMBOL_FILE = $(PROJ_SRC_DIR)/CIndex.exports
+EXPORTED_SYMBOL_FILE = $(PROJ_SRC_DIR)/libclang.exports
CPP.Flags += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include