# Detect B&I builds.
set(SWIFT_BNI_OS_BUILD FALSE)
set(SWIFT_BNI_XCODE_BUILD FALSE)
if(DEFINED ENV{RC_XBS})
  if(NOT DEFINED ENV{RC_XCODE} OR NOT "$ENV{RC_XCODE}")
    set(SWIFT_BNI_OS_BUILD TRUE)
  else()
    set(SWIFT_BNI_XCODE_BUILD TRUE)
  endif()
endif()

configure_file(CMakeConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/CMakeConfig.h
               ESCAPE_QUOTES @ONLY)

# Detect B&I builds.
set(SWIFT_BNI_OS_BUILD FALSE)
set(SWIFT_BNI_XCODE_BUILD FALSE)
if(DEFINED ENV{RC_XBS})
  if(NOT DEFINED ENV{RC_XCODE} OR NOT "$ENV{RC_XCODE}")
    set(SWIFT_BNI_OS_BUILD TRUE)
  else()
    set(SWIFT_BNI_XCODE_BUILD TRUE)
  endif()
endif()

configure_file(CMakeConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/CMakeConfig.h
               ESCAPE_QUOTES @ONLY)
swift_install_in_component(FILES ${CMAKE_CURRENT_BINARY_DIR}/CMakeConfig.h
                           DESTINATION "include/swift/Runtime"
                           COMPONENT testsuite-tools)

Install CMakeConfig.h as a testsuite-tool into the just built toolchain. Needed to run tests against the just built toolchain.
[swift-stage2] Install CMakeConfig.h as a testsuite-tool into the just built toolchain. Needed to run tests against the just built toolchain.
