# Building libclang_shared.so fails if LLVM_ENABLE_PIC=Off
if (NOT LLVM_ENABLE_PIC)
  return()
endif()

get_property(clang_libs GLOBAL PROPERTY CLANG_STATIC_LIBS)

foreach (lib ${clang_libs})
  list(APPEND _OBJECTS $<TARGET_OBJECTS:obj.${lib}>)
  list(APPEND _DEPS $<TARGET_PROPERTY:${lib},INTERFACE_LINK_LIBRARIES>)
  list(APPEND _DEPS $<TARGET_PROPERTY:${lib},PRIVATE_LINK_LIBRARIES>)
endforeach ()

add_clang_library(clang_shared
                  SHARED
                  clang-shlib.cpp
                  ${_OBJECTS}
                  LINK_LIBS
                  ${_DEPS})

# Building libclang_shared.so fails if LLVM_ENABLE_PIC=Off
if (NOT LLVM_ENABLE_PIC)
  return()
endif()

get_property(clang_libs GLOBAL PROPERTY CLANG_STATIC_LIBS)

foreach (lib ${clang_libs})
  list(APPEND _OBJECTS $<TARGET_OBJECTS:obj.${lib}>)
  list(APPEND _DEPS $<TARGET_PROPERTY:${lib},INTERFACE_LINK_LIBRARIES>)
  list(APPEND _DEPS $<TARGET_PROPERTY:${lib},LINK_LIBRARIES>)
endforeach ()

add_clang_library(clang_shared
                  SHARED
                  clang-shlib.cpp
                  ${_OBJECTS}
                  LINK_LIBS
                  ${_DEPS})

Fix target property to make BUILD_SHARED_LIBS work
Fix target property to make BUILD_SHARED_LIBS work

Public and Private link libraries get merged in the LINK_LIBRARIES property instead of being kept separate.

With any luck this will get `BUILD_SHARED_LIBS` working again on Linux.

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@361334 91177308-0d34-0410-b5e6-96231b3b80d8
