@@ -60,8 +60,13 @@ def build(self, host_target):
60
60
except OSError :
61
61
pass
62
62
63
- with shell .pushd (self .build_dir ):
63
+ # SWIFT_ENABLE_TENSORFLOW
64
+ target = ''
65
+ if host_target .startswith ('macosx' ):
66
+ target = '-DCMAKE_Swift_COMPILER_TARGET=x86_64-apple-macosx10.13'
67
+ # SWIFT_ENABLE_TENSORFLOW END
64
68
69
+ with shell .pushd (self .build_dir ):
65
70
shell .call ([
66
71
self .toolchain .cmake ,
67
72
'-G' , 'Ninja' ,
@@ -71,15 +76,16 @@ def build(self, host_target):
71
76
'-D' , 'CMAKE_MAKE_PROGRAM={}' .format (self .toolchain .ninja ),
72
77
'-D' , 'CMAKE_Swift_COMPILER={}' .format (swiftc ),
73
78
# SWIFT_ENABLE_TENSORFLOW
79
+ target ,
74
80
'-D' , 'USE_BUNDLED_CTENSORFLOW=YES' ,
75
- # SWIFT_ENABLE_TENSORFLOW END
76
81
'-D' , 'TensorFlow_INCLUDE_DIR={}' .format (tensorflow_source_dir ),
77
82
'-D' , 'TensorFlow_LIBRARY={}' .format (
78
83
os .path .join (tensorflow_source_dir , 'bazel-bin' , 'tensorflow' ,
79
84
lib_name )),
80
85
'-D' , 'CMAKE_Swift_FLAGS={}' .format ('-L{}' .format (
81
86
os .path .join (tensorflow_source_dir , 'bazel-bin' , 'tensorflow' ))
82
87
),
88
+ # SWIFT_ENABLE_TENSORFLOW END
83
89
'-B' , self .build_dir ,
84
90
'-S' , self .source_dir ,
85
91
])
0 commit comments