set(LLVM_LINK_COMPONENTS Support IPO)

add_library(DynamicLibraryLib STATIC ExportedFuncs.cxx)

add_llvm_unittest(DynamicLibraryTests DynamicLibraryTest.cpp)
target_link_libraries(DynamicLibraryTests DynamicLibraryLib)
export_executable_symbols(DynamicLibraryTests)

function(dynlib_add_module NAME)
  add_library(${NAME} SHARED PipSqueak.cxx)

  set_output_directory(${NAME}
    BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
    LIBRARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
    )

  set_target_properties(${NAME}
    PROPERTIES PREFIX ""
    SUFFIX ".so"
    )

  add_dependencies(DynamicLibraryTests ${NAME})
endfunction(dynlib_add_module)

dynlib_add_module(PipSqueak)
dynlib_add_module(SecondLib)

set(LLVM_LINK_COMPONENTS Support IPO)

add_library(DynamicLibraryLib STATIC ExportedFuncs.cxx)

add_llvm_unittest(DynamicLibraryTests DynamicLibraryTest.cpp)
target_link_libraries(DynamicLibraryTests DynamicLibraryLib)
export_executable_symbols(DynamicLibraryTests)

function(dynlib_add_module NAME)
  add_library(${NAME} SHARED PipSqueak.cxx)

  set_output_directory(${NAME}
    BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
    LIBRARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
    )

  set_target_properties(${NAME}
    PROPERTIES PREFIX ""
    SUFFIX ".so"
    )

  add_dependencies(DynamicLibraryTests ${NAME})
  llvm_update_compile_flags(${NAME})
endfunction(dynlib_add_module)

dynlib_add_module(PipSqueak)
dynlib_add_module(SecondLib)

Fix self hosting build-bot failure from r305303 by adjusting DynamicLibraryTests compile flags.
Fix self hosting build-bot failure from r305303 by adjusting DynamicLibraryTests compile flags.

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@305313 91177308-0d34-0410-b5e6-96231b3b80d8
