Revision 4d903f9c1c7b5fbd3864959120f457b83e2d743d authored by Slava Pestov on 16 January 2016, 02:37:57 UTC, committed by Slava Pestov on 19 January 2016, 22:22:14 UTC
In master, this was fixed by Luke Howard as part of some other changes in the
following patch:

<https://github.com/apple/swift/commit/b5880f386b814f8b5cb220d1c4e65e74c04eccf4>

This patch back-ports the relevant part of the above (checking for a true
return value from hasMetadataPattern() vs checking for a BoundGenericType).

Fixes <rdar://problem/24183374>.
1 parent b971595
Raw File
CMakeLists.txt
add_custom_target(SwiftUnitTests)

set_target_properties(SwiftUnitTests PROPERTIES FOLDER "Tests")

function(add_swift_unittest test_dirname)
  add_unittest(SwiftUnitTests ${test_dirname} ${ARGN})

  if(SWIFT_BUILT_STANDALONE AND NOT "${CMAKE_CFG_INTDIR}" STREQUAL ".")
    # Replace target references with full paths, so that we use LLVM's
    # build configuration rather than Swift's.
    get_target_property(libnames ${test_dirname} LINK_LIBRARIES)

    set(new_libnames)
    foreach(dep ${libnames})
      if("${dep}" MATCHES "^(LLVM|Clang|gtest)")
        list(APPEND new_libnames "${LLVM_LIBRARY_OUTPUT_INTDIR}/lib${dep}.a")
      else()
        list(APPEND new_libnames "${dep}")
      endif()
    endforeach()

    set_property(TARGET ${test_dirname} PROPERTY LINK_LIBRARIES ${new_libnames})
    swift_common_llvm_config(${test_dirname} support)
  endif()

  if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
    set_property(TARGET "${test_dirname}" APPEND_STRING PROPERTY
      LINK_FLAGS " -Xlinker -rpath -Xlinker ${SWIFT_LIBRARY_OUTPUT_INTDIR}/swift/macosx")
  endif()
endfunction()

if(SWIFT_BUILD_TOOLS)
  # We can't link C++ unit tests unless we build the tools.

  add_subdirectory(Availability)
  add_subdirectory(Basic)
  add_subdirectory(Driver)
  add_subdirectory(IDE)
  add_subdirectory(Parse)
  add_subdirectory(SwiftDemangle)

  if(SWIFT_BUILD_SDK_OVERLAY)
    # Runtime tests depend on symbols in StdlibUnittest.
    #
    # FIXME: cross-compile runtime unittests.
    add_subdirectory(runtime)
  endif()

  if(SWIFT_BUILD_SOURCEKIT)
    add_subdirectory(SourceKit)
  endif()
endif()

back to top