File tree Expand file tree Collapse file tree 2 files changed +10
-12
lines changed Expand file tree Collapse file tree 2 files changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ if(SWIFT_BUILD_STDLIB)
75
75
76
76
# Note: Python should be built before TensorFlow because Python is a
77
77
# dependency for `numpy.ndarray` bridging to `ShapedArray`/`Tensor`.
78
- if (SWIFT_ENABLE_TENSORFLOW )
78
+ if (SWIFT_ENABLE_TENSORFLOW AND TENSORFLOW_SWIFT_APIS )
79
79
# TODO: Add TensorFlow support for iOS/Raspberry Pi.
80
80
add_subdirectory (TensorFlow )
81
81
endif ()
Original file line number Diff line number Diff line change 16
16
17
17
find_package (TensorFlow REQUIRED )
18
18
message (STATUS "Building TensorFlow." )
19
+ message (STATUS "Using TensorFlow high-level APIs library." )
20
+
19
21
20
22
set (CMAKE_BUILD_WITH_INSTALL_RPATH TRUE )
21
23
set (swift_stdlib_compile_flags "${SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS} " )
@@ -29,17 +31,13 @@ list(APPEND swift_stdlib_compile_flags "-DCOMPILING_TENSORFLOW_STDLIB_MODULE")
29
31
30
32
set (SOURCES "" )
31
33
32
- # Copy TensorFlow high-level API sources, if they exist.
33
- if (TENSORFLOW_SWIFT_APIS )
34
- message (STATUS "Using TensorFlow high-level APIs library." )
35
-
36
- file (GLOB_RECURSE TENSORFLOW_SWIFT_API_SOURCES
37
- "${TENSORFLOW_SWIFT_APIS} /Sources/*.swift" )
38
- foreach (_TENSORFLOW_SWIFT_APIS_SOURCE ${TENSORFLOW_SWIFT_API_SOURCES} )
39
- file (TO_CMAKE_PATH ${_TENSORFLOW_SWIFT_APIS_SOURCE} _TENSORFLOW_SWIFT_APIS_SOURCE )
40
- list (APPEND SOURCES ${_TENSORFLOW_SWIFT_APIS_SOURCE} )
41
- endforeach ()
42
- endif ()
34
+ # Copy TensorFlow high-level API sources.
35
+ file (GLOB_RECURSE TENSORFLOW_SWIFT_API_SOURCES
36
+ "${TENSORFLOW_SWIFT_APIS} /Sources/*.swift" )
37
+ foreach (_TENSORFLOW_SWIFT_APIS_SOURCE ${TENSORFLOW_SWIFT_API_SOURCES} )
38
+ file (TO_CMAKE_PATH ${_TENSORFLOW_SWIFT_APIS_SOURCE} _TENSORFLOW_SWIFT_APIS_SOURCE )
39
+ list (APPEND SOURCES ${_TENSORFLOW_SWIFT_APIS_SOURCE} )
40
+ endforeach ()
43
41
44
42
add_swift_target_library (swiftTensorFlow ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
45
43
"${SOURCES} "
You can’t perform that action at this time.
0 commit comments