@@ -141,16 +141,18 @@ def common_options(self, product=None):
141
141
142
142
if self .prefer_just_built_toolchain and product :
143
143
toolchain_path = product .install_toolchain_path (args .host_target )
144
+ cmake_swiftc_path = os .getenv ('CMAKE_Swift_COMPILER' ,
145
+ os .path .join (toolchain_path , 'bin' , 'swiftc' ))
144
146
define ("CMAKE_C_COMPILER:PATH" , os .path .join (toolchain_path ,
145
147
'bin' , 'clang' ))
146
148
define ("CMAKE_CXX_COMPILER:PATH" , os .path .join (toolchain_path ,
147
149
'bin' , 'clang++' ))
148
- define ("CMAKE_Swift_COMPILER:PATH" , os .path .join (toolchain_path ,
149
- 'bin' , 'swiftc' ))
150
+ define ("CMAKE_Swift_COMPILER:PATH" , cmake_swiftc_path )
150
151
else :
152
+ cmake_swiftc_path = os .getenv ('CMAKE_Swift_COMPILER' , toolchain .swiftc )
151
153
define ("CMAKE_C_COMPILER:PATH" , toolchain .cc )
152
154
define ("CMAKE_CXX_COMPILER:PATH" , toolchain .cxx )
153
- define ("CMAKE_Swift_COMPILER:PATH" , toolchain . swiftc )
155
+ define ("CMAKE_Swift_COMPILER:PATH" , cmake_swiftc_path )
154
156
define ("CMAKE_LIBTOOL:PATH" , toolchain .libtool )
155
157
define ("CMAKE_AR:PATH" , toolchain .ar )
156
158
define ("CMAKE_RANLIB:PATH" , toolchain .ranlib )
0 commit comments