# FIXME: The CMake-with-Xcode build puts things in a different
# directly layout than the autoconf build, which makes relative paths
# for finding the Clang location pretty horrible. Work around it.
if (XCODE)
  add_definitions(-DSWIFT_BUILT_WITH_CMAKE)
endif ()

add_swift_library(swiftClangImporter
  ClangDiagnosticConsumer.cpp
  ClangImporter.cpp
  ImportDecl.cpp
  ImportMacro.cpp
  ImportType.cpp
  DEPENDS swiftAST)

# Clang dependencies.
# FIXME: Clang should really export these in some reasonable manner.
target_link_libraries(swiftClangImporter
  clangIndex
  clangFormat
  clangTooling
  clangFormat
  clangFrontendTool
  clangFrontend
  clangDriver
  clangSerialization
  clangParse
  clangSema
  clangAnalysis
  clangEdit
  clangRewriteFrontend
  clangRewrite
  clangAST
  clangLex
  clangAPINotes
  clangBasic
  LLVMBitReader
  LLVMMC
  LLVMMCParser
  LLVMOption
  LLVMTransformUtils
  LLVMSupport)

# FIXME: The CMake-with-Xcode build puts things in a different
# directly layout than the autoconf build, which makes relative paths
# for finding the Clang location pretty horrible. Work around it.
if (XCODE)
  add_definitions(-DSWIFT_BUILT_WITH_CMAKE)
endif ()

add_swift_library(swiftClangImporter
  ClangDiagnosticConsumer.cpp
  ClangImporter.cpp
  ImportDecl.cpp
  ImportMacro.cpp
  ImportType.cpp
  DEPENDS swiftAST)

# Clang dependencies.
# FIXME: Clang should really export these in some reasonable manner.
target_link_libraries(swiftClangImporter
  clangIndex
  clangFormat
  clangTooling
  clangFrontendTool
  clangFrontend
  clangDriver
  clangSerialization
  clangParse
  clangSema
  clangAnalysis
  clangEdit
  clangRewriteFrontend
  clangRewrite
  clangAST
  clangLex
  clangAPINotes
  clangBasic
  LLVMBitReader
  LLVMMC
  LLVMMCParser
  LLVMOption
  LLVMTransformUtils
  LLVMSupport)

Remove duplicate library from the dependency list
Remove duplicate library from the dependency list

Swift SVN r22459
