Skip to content

CMake based Foundation Support & Test #230

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ add_swift_library(XCTest
OUTPUT
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}XCTest${CMAKE_SHARED_LIBRARY_SUFFIX}
LINK_FLAGS
-L${XCTEST_PATH_TO_LIBDISPATCH_BUILD}
-L${XCTEST_PATH_TO_LIBDISPATCH_BUILD}/src -ldispatch
-L${XCTEST_PATH_TO_FOUNDATION_BUILD} -lFoundation

Expand Down Expand Up @@ -122,7 +123,7 @@ add_custom_target(check-xctest
FOUNDATION_BUILT_PRODUCTS_DIR=${XCTEST_PATH_TO_FOUNDATION_BUILD}
LIBDISPATCH_SRC_DIR=${XCTEST_PATH_TO_LIBDISPATCH_SOURCE}
LIBDISPATCH_BUILD_DIR=${XCTEST_PATH_TO_LIBDISPATCH_BUILD}
LIBDISPATCH_OVERLAY_DIR=${XCTEST_PATH_TO_LIBDISPATCH_BUILD}/swift
LIBDISPATCH_OVERLAY_DIR=${XCTEST_PATH_TO_LIBDISPATCH_BUILD}/src/swift
SWIFT_EXEC=${CMAKE_SWIFT_COMPILER}
${LIT_COMMAND} -sv ${CMAKE_SOURCE_DIR}/Tests/Functional
COMMENT
Expand Down
6 changes: 4 additions & 2 deletions Tests/Functional/lit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ else:
'-I', foundation_dir,
'-I', os.path.join(foundation_dir, 'swift'),
'-I', core_foundation_dir,
'-F', os.path.join(core_foundation_dir, 'System', 'Library', 'Frameworks'),
'-Xcc', '-F', '-Xcc', os.path.join(core_foundation_dir, 'System', 'Library', 'Frameworks'),
])
config.environment['LD_LIBRARY_PATH'] = foundation_dir

# We also need to link swift-corelibs-libdispatch, if
# swift-corelibs-foundation is using it.
libdispatch_src_dir = os.getenv('LIBDISPATCH_SRC_DIR')
Expand All @@ -98,6 +98,8 @@ else:
'-L', os.path.join(libdispatch_build_dir, 'src'),
])

config.environment['LD_LIBRARY_PATH'] = "{}:{}/src:{}".format(libdispatch_build_dir, libdispatch_build_dir, foundation_dir)

# Having prepared the swiftc command, we set the substitution.
config.substitutions.append(('%{swiftc}', ' '.join(swift_exec)))

Expand Down