summaryrefslogtreecommitdiffstats
path: root/tools/CIndex/CMakeLists.txt
blob: dd0eeea9443ad98bc48d602bf29bad86b82d0fa4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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()

if(MSVC)
  # 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(NON_ANSI_COMPILE_FLAGS "${NON_ANSI_COMPILE_FLAGS} /D_CINDEX_LIB_")
  set_target_properties(CIndex PROPERTIES COMPILE_FLAGS ${NON_ANSI_COMPILE_FLAGS})
endif(MSVC)

set_target_properties(CIndex
  PROPERTIES
  LINKER_LANGUAGE CXX)
OpenPOWER on IntegriCloud