-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Add libQuote to apple/swift:tensorflow CI #26708
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#===-------------- CMakeLists.txt - Build the Quote library ---------------===# | ||
# | ||
# This source file is part of the Swift.org open source project | ||
# | ||
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors | ||
# Licensed under Apache License v2.0 with Runtime Library Exception | ||
# | ||
# See https://swift.org/LICENSE.txt for license information | ||
# See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors | ||
# | ||
#===----------------------------------------------------------------------===# | ||
# | ||
# SWIFT_ENABLE_TENSORFLOW | ||
# | ||
#===----------------------------------------------------------------------===# | ||
|
||
if(NOT SWIFT_ENABLE_TENSORFLOW) | ||
return() | ||
endif() | ||
|
||
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) | ||
set(swift_stdlib_compile_flags "${SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS}") | ||
|
||
set(SOURCES "") | ||
|
||
# Copy Quote sources, if they exist. | ||
if (TENSORFLOW_SWIFT_QUOTE) | ||
file(GLOB_RECURSE TENSORFLOW_SWIFT_QUOTE_SOURCES | ||
"${TENSORFLOW_SWIFT_QUOTE}/Sources/Quote/*.swift") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is really an anti-pattern for CMake. If you do this, subsequent incremental builds will be incorrect as this will not pick up new files being added - it is evaluated once. It is much better to explicitly list out the sources. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the right way of doing this? My knowledge of CMake is cursory at best, so I'd appreciate any help :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is to explicitly list out all the source files manually. Doing so allows CMake to indicate to the build tool which files to track. You would literally just enumerate the files and write them out. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just a note: the file list here actually refers to files from a different repository (a different In practice, this means that when files are added/removed, we'll need to update the CMake source list when we update |
||
list(APPEND SOURCES "${TENSORFLOW_SWIFT_QUOTE_SOURCES}") | ||
endif() | ||
|
||
add_swift_target_library(swiftQuote ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB | ||
"${SOURCES}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. BTW, once you actually list out the files, you can just delete the |
||
|
||
TARGET_SDKS OSX LINUX | ||
PRIVATE_LINK_LIBRARIES "${TF_LIBRARIES}" | ||
SWIFT_MODULE_DEPENDS SwiftOnoneSupport | ||
SWIFT_MODULE_DEPENDS_IOS Darwin | ||
SWIFT_MODULE_DEPENDS_OSX Darwin | ||
SWIFT_MODULE_DEPENDS_TVOS Darwin | ||
SWIFT_MODULE_DEPENDS_WATCHOS Darwin | ||
SWIFT_MODULE_DEPENDS_LINUX Glibc | ||
SWIFT_MODULE_DEPENDS_FREEBSD Glibc | ||
SWIFT_MODULE_DEPENDS_CYGWIN Glibc | ||
SWIFT_MODULE_DEPENDS_HAIKU Glibc | ||
SWIFT_COMPILE_FLAGS "${swift_stdlib_compile_flags}" | ||
LINK_FLAGS "${SWIFT_RUNTIME_SWIFT_LINK_FLAGS}" | ||
INSTALL_IN_COMPONENT stdlib | ||
# NOTE: This is a workaround for https://github.com/apple/swift/pull/24382, | ||
# which changed the default install_name_dir to `/usr/bin/swift`. | ||
DARWIN_INSTALL_NAME_DIR "@rpath") |
Uh oh!
There was an error while loading. Please reload this page.