Skip to content

Commit eaa9937

Browse files
committed
TensorFlow: switch to using CTensorFlow from swift-apis
This adjusts the build to stop replicating the CTensorFlow module locally and instead using the version in the swift-apis repository. This more closely mimics the build as if it were out-of-tree enabling a simpler migration to building this package out-of-tree.
1 parent 0629d3f commit eaa9937

File tree

3 files changed

+5
-17
lines changed

3 files changed

+5
-17
lines changed

stdlib/public/TensorFlow/CMakeLists.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,10 @@ if (TENSORFLOW_SWIFT_APIS)
4141
endforeach()
4242
endif()
4343

44-
get_filename_component(TensorFlow_LIBRARY_DIR ${TF_LIBRARY} DIRECTORY)
4544
add_swift_target_library(swiftTensorFlow ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
4645
"${SOURCES}"
4746

48-
PRIVATE_LINK_LIBRARIES "${TF_LIBRARIES}"
47+
PRIVATE_LINK_LIBRARIES ${TF_LIBRARY}
4948
SWIFT_MODULE_DEPENDS SwiftOnoneSupport
5049
SWIFT_MODULE_DEPENDS_IOS Darwin
5150
SWIFT_MODULE_DEPENDS_OSX Darwin
@@ -59,7 +58,7 @@ add_swift_target_library(swiftTensorFlow ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_
5958
SWIFT_MODULE_DEPENDS Python
6059
SWIFT_COMPILE_FLAGS
6160
${swift_stdlib_compile_flags}
62-
-Xcc -I${CMAKE_CURRENT_SOURCE_DIR}
61+
-Xcc -I${TENSORFLOW_SWIFT_APIS}/Sources/CTensorFlow
6362
-Xcc -I${TF_INCLUDE_DIR}
6463
LINK_FLAGS
6564
${SWIFT_RUNTIME_SWIFT_LINK_FLAGS}
@@ -82,6 +81,8 @@ swift_install_in_component(DIRECTORY ${TF_INCLUDE_DIR}/tensorflow/c/
8281
PATTERN tf_status.h
8382
PATTERN tf_tensor.h
8483
PATTERN eager/c_api.h)
85-
swift_install_in_component(FILES module.modulemap CTensorFlow.h
84+
swift_install_in_component(FILES
85+
${TENSORFLOW_SWIFT_APIS}/Sources/CTensorFlow/module.modulemap
86+
${TENSORFLOW_SWIFT_APIS}/Sources/CTensorFlow/CTensorFlow.h
8687
DESTINATION lib/swift/tensorflow
8788
COMPONENT stdlib)

stdlib/public/TensorFlow/CTensorFlow.h

Lines changed: 0 additions & 8 deletions
This file was deleted.

stdlib/public/TensorFlow/module.modulemap

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)