mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
We need to actually keep the XCTest support in an overlay for now. This reverts commit 4a2726862634a553483943baf39a251ac8071e37. Addresses <rdar://problem/17423669>. Swift SVN r19101
40 lines
1.4 KiB
CMake
40 lines
1.4 KiB
CMake
set(SHARED_LIBRARY ON)
|
|
set(DISABLE_APPLICATION_EXTENSION ON)
|
|
set(SWIFTXCTEST_SOURCES
|
|
XCTestCaseAdditions.mm
|
|
XCTest.swift
|
|
)
|
|
|
|
# XCTest.framework is provided by Xcode in the platforms, though that's recent
|
|
# and may not have made it to all platforms yet so fall back to the SDK in those
|
|
# cases.
|
|
#
|
|
# Also, since it's not in the default search paths, add a search path for it
|
|
# both when building and when linking. For compiling, that's accomplished by
|
|
# modifying SWIFT_EXTRA_FLAGS before invoking add_swift_library. For linking,
|
|
# that's accomplished by adding the extra flag to target_link_libraries since
|
|
# that will just pass through to the linker invocation.
|
|
|
|
if (EXISTS "${MODULES_SDK}/../../../Developer/Library/Frameworks/XCTest.framework/Headers")
|
|
set(XCTEST_FRAMEWORK_LOCATION "${MODULES_SDK}/../../../Developer/Library/Frameworks")
|
|
else()
|
|
set(XCTEST_FRAMEWORK_LOCATION "${MODULES_SDK}/Developer/Library/Frameworks")
|
|
endif()
|
|
|
|
list(APPEND SWIFT_EXTRA_FLAGS
|
|
"-F${XCTEST_FRAMEWORK_LOCATION}"
|
|
"-framework" "XCTest")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -F${XCTEST_FRAMEWORK_LOCATION}")
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -framework XCTest")
|
|
|
|
add_swift_library(swiftXCTest INSTALL
|
|
${SWIFTXCTEST_SOURCES}
|
|
DEPENDS swift_stdlib_core swiftObjectiveC swiftFoundation)
|
|
|
|
add_swift_optimization_flags(swiftXCTest)
|
|
|
|
target_link_libraries(swiftXCTest
|
|
"-F${XCTEST_FRAMEWORK_LOCATION}"
|
|
"-framework Foundation" "-framework XCTest")
|