@@ -141,16 +141,18 @@ def common_options(self, product=None):
141141
142142 if self .prefer_just_built_toolchain and product :
143143 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' ))
144146 define ("CMAKE_C_COMPILER:PATH" , os .path .join (toolchain_path ,
145147 'bin' , 'clang' ))
146148 define ("CMAKE_CXX_COMPILER:PATH" , os .path .join (toolchain_path ,
147149 '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 )
150151 else :
152+ cmake_swiftc_path = os .getenv ('CMAKE_Swift_COMPILER' , toolchain .swiftc )
151153 define ("CMAKE_C_COMPILER:PATH" , toolchain .cc )
152154 define ("CMAKE_CXX_COMPILER:PATH" , toolchain .cxx )
153- define ("CMAKE_Swift_COMPILER:PATH" , toolchain . swiftc )
155+ define ("CMAKE_Swift_COMPILER:PATH" , cmake_swiftc_path )
154156 define ("CMAKE_LIBTOOL:PATH" , toolchain .libtool )
155157 define ("CMAKE_AR:PATH" , toolchain .ar )
156158 define ("CMAKE_RANLIB:PATH" , toolchain .ranlib )
0 commit comments