# All libraries in this directory tree are overlays.
list(APPEND SWIFT_EXTRA_FLAGS
  "-autolink-force-load")

# Build the swiftObjC dylib.
set(SHARED_LIBRARY ON)

set(SWIFTOBJC_SOURCES
    ObjectiveC.swift)

# Definition of ObjCBool is platform-specific.
if (SWIFT_DEPLOYMENT_OS MATCHES "^macosx" 
    OR
    (SWIFT_DEPLOYMENT_OS MATCHES "^iphone" 
     AND NOT (CMAKE_OSX_ARCHITECTURES MATCHES "64$")))
  # OS X or 32-bit iOS: Objective-C BOOL is signed char
  list(APPEND SWIFTOBJC_SOURCES 
    ObjectiveC-BOOLchar.swift)
else()
  # Others: Objective-C BOOL is C99/C++ bool.
  list(APPEND SWIFTOBJC_SOURCES 
    ObjectiveC-BOOLbool.swift)
endif()

add_swift_library(swiftObjectiveC INSTALL
  ${SWIFTOBJC_SOURCES}
  DEPENDS swift_stdlib_core swiftDarwin)


add_subdirectory(Darwin)
add_subdirectory(Dispatch)
add_subdirectory(CoreGraphics)
add_subdirectory(Foundation)
add_subdirectory(SpriteKit)

if (SWIFT_DEPLOYMENT_OS MATCHES "^macosx")
  add_subdirectory(AppKit)
else()
  add_subdirectory(UIKit)
endif()

# FIXME: Temporarily allow one to disable building this overlay module.
option(SWIFT_BUILD_XCTEST "Build XCTest overlay" YES)
if (SWIFT_BUILD_XCTEST)
  add_subdirectory(XCTest)
endif()

# Build the swiftObjC dylib.
set(SHARED_LIBRARY ON)

set(SWIFTOBJC_SOURCES
    ObjectiveC.swift)

# Definition of ObjCBool is platform-specific.
if (SWIFT_DEPLOYMENT_OS MATCHES "^macosx" 
    OR
    (SWIFT_DEPLOYMENT_OS MATCHES "^iphone" 
     AND NOT (CMAKE_OSX_ARCHITECTURES MATCHES "64$")))
  # OS X or 32-bit iOS: Objective-C BOOL is signed char
  list(APPEND SWIFTOBJC_SOURCES 
    ObjectiveC-BOOLchar.swift)
else()
  # Others: Objective-C BOOL is C99/C++ bool.
  list(APPEND SWIFTOBJC_SOURCES 
    ObjectiveC-BOOLbool.swift)
endif()

add_swift_library(swiftObjectiveC INSTALL
  ${SWIFTOBJC_SOURCES}
  DEPENDS swift_stdlib_core swiftDarwin)

add_subdirectory(Darwin)
add_subdirectory(Dispatch)
add_subdirectory(CoreGraphics)
add_subdirectory(Foundation)
add_subdirectory(SpriteKit)

if (SWIFT_DEPLOYMENT_OS MATCHES "^macosx")
  add_subdirectory(AppKit)
else()
  add_subdirectory(UIKit)
endif()

# FIXME: Temporarily allow one to disable building this overlay module.
option(SWIFT_BUILD_XCTEST "Build XCTest overlay" YES)
if (SWIFT_BUILD_XCTEST)
  add_subdirectory(XCTest)
endif()

Revert "[CMake] Build the SDK overlays with -autolink-force-load."
Revert "[CMake] Build the SDK overlays with -autolink-force-load."

This reverts commit r17752, because it caused link failures of Interpreter and stdlib tests.

Swift SVN r17758
