[cfe-commits] r82755 - in /cfe/trunk: CMakeLists.txt tools/CIndex/CMakeLists.txt tools/CMakeLists.txt

Douglas Gregor dgregor at apple.com
Thu Sep 24 23:35:16 PDT 2009


Author: dgregor
Date: Fri Sep 25 01:35:15 2009
New Revision: 82755

URL: http://llvm.org/viewvc/llvm-project?rev=82755&view=rev
Log:
CMake build support for libCIndex and c-index-test. The indexing tests
are now running properly from within CMake.

Added:
    cfe/trunk/tools/CIndex/CMakeLists.txt   (with props)
Modified:
    cfe/trunk/CMakeLists.txt
    cfe/trunk/tools/CMakeLists.txt

Modified: cfe/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CMakeLists.txt?rev=82755&r1=82754&r2=82755&view=diff

==============================================================================
--- cfe/trunk/CMakeLists.txt (original)
+++ cfe/trunk/CMakeLists.txt Fri Sep 25 01:35:15 2009
@@ -34,10 +34,23 @@
       ../../include/clang${dir}/*.def)
     set(srcs ${srcs} ${headers})
   endif(MSVC_IDE OR XCODE)
-  add_library( ${name} ${srcs} )
+  if (SHARED_LIBRARY)
+    set(libkind SHARED)
+  else()
+    set(libkind)
+  endif()
+  add_library( ${name} ${libkind} ${srcs} )
   if( LLVM_COMMON_DEPENDS )
     add_dependencies( ${name} ${LLVM_COMMON_DEPENDS} )
   endif( LLVM_COMMON_DEPENDS )
+  if( LLVM_LINK_COMPONENTS )
+    llvm_config(${name} ${LLVM_LINK_COMPONENTS})
+  endif( LLVM_LINK_COMPONENTS )
+  if( LLVM_USED_LIBS )
+    foreach(lib ${LLVM_USED_LIBS})
+      target_link_libraries( ${name} ${lib} )
+    endforeach(lib)
+  endif( LLVM_USED_LIBS )
   add_dependencies(${name} ClangDiagnosticCommon)
   if(MSVC)
     get_target_property(cflag ${name} COMPILE_FLAGS)

Added: cfe/trunk/tools/CIndex/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/CIndex/CMakeLists.txt?rev=82755&view=auto

==============================================================================
--- cfe/trunk/tools/CIndex/CMakeLists.txt (added)
+++ cfe/trunk/tools/CIndex/CMakeLists.txt Fri Sep 25 01:35:15 2009
@@ -0,0 +1,23 @@
+set(SHARED_LIBRARY TRUE)
+
+set(LLVM_NO_RTTI 1)
+
+set(LLVM_USED_LIBS
+  clangFrontend clangIndex clangSema clangAST clangLex clangBasic)
+
+set( LLVM_LINK_COMPONENTS
+  MC
+  support
+  )
+
+add_clang_library(CIndex CIndex.cpp)
+
+if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+  # FIXME: Deal with LLVM_SUBMIT_VERSION?
+
+  set_target_properties(CIndex
+    PROPERTIES
+    LINK_FLAGS "-avoid-version -Wl,-exported_symbols_list -Wl,${CMAKE_CURRENT_SOURCE_DIR}/CIndex.exports -Wl,-dead_strip -Wl,-seg1addr -Wl,0xE0000000"
+    INSTALL_NAME_DIR "@executable_path/../lib"
+    )
+endif()

Propchange: cfe/trunk/tools/CIndex/CMakeLists.txt

------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cfe/trunk/tools/CIndex/CMakeLists.txt

------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cfe/trunk/tools/CIndex/CMakeLists.txt

------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: cfe/trunk/tools/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/CMakeLists.txt?rev=82755&r1=82754&r2=82755&view=diff

==============================================================================
--- cfe/trunk/tools/CMakeLists.txt (original)
+++ cfe/trunk/tools/CMakeLists.txt Fri Sep 25 01:35:15 2009
@@ -5,3 +5,5 @@
 if (CLANG_BUILD_EXPERIMENTAL)
   add_subdirectory(wpa)
 endif ()
+add_subdirectory(CIndex)
+add_subdirectory(c-index-test)





More information about the cfe-commits mailing list