You can use set SDKROOT=
to avoid SDK collision, but you also have to take care of the installation path in case of unexpectedly breaking the current installation.
Thank you, now the build did progressed a bit further. By setting SDKROOT=S:\b\1 the build went on. However, it later fails because it cannot find Foundation.
[3/4] Linking Swift executable bin\swift-help.exe
Creating library bin\swift-help.lib and object bin\swift-help.exp
[3/4] Install the project...-- Install configuration: "Release"
-- Installing: S:/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/lib/SwiftOptions.lib
-- Installing: S:/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/SwiftOptions.dll
-- Installing: S:/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/lib/SwiftDriver.lib
-- Installing: S:/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/SwiftDriver.dll
-- Installing: S:/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/lib/SwiftDriverExecution.lib
-- Installing: S:/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/SwiftDriverExecution.dll
-- Installing: S:/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swift-build-sdk-interfaces.exe
-- Installing: S:/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swift-driver.exe
-- Installing: S:/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swift-help.exe
The system cannot find the path specified.
The system cannot find the path specified.
-- The ASM compiler identification is MSVC
-- Found assembler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe
-- The C compiler identification is MSVC 19.34.31933.0
-- The Swift compiler identification is Apple 5.8
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working Swift compiler: S:/b/1/bin/swiftc.exe
-- Check for working Swift compiler: S:/b/1/bin/swiftc.exe - works
-- Configuring done
-- Generating done
-- Build files have been written to: S:/b/8
[308/309] Linking Swift shared library bin\CryptoBoringWrapper.dll
FAILED: bin/CryptoBoringWrapper.dll Sources/CryptoBoringWrapper/CMakeFiles/CryptoBoringWrapper.dir/AEAD/BoringSSLAEAD.swift.obj Sources/CryptoBoringWrapper/CMakeFiles/CryptoBoringWrapper.dir/CryptoKitErrors_boring.swift.obj swift/CryptoBoringWrapper.swiftmodule lib/CryptoBoringWrapper.lib
cmd.exe /C "cd . && S:\b\1\bin\swiftc.exe -output-file-map Sources\CryptoBoringWrapper\CMakeFiles\CryptoBoringWrapper.dir\Release\output-file-map.json -incremental -j 8 -emit-library -o bin\CryptoBoringWrapper.dll -module-name CryptoBoringWrapper -module-link-name CryptoBoringWrapper -emit-module -emit-module-path swift\CryptoBoringWrapper.swiftmodule -emit-dependencies -DCryptoBoringWrapper_EXPORTS -O -libc MD -I S:\SourceCache\swift-crypto\Sources\CCryptoBoringSSL\include -I S:\SourceCache\swift-crypto\Sources\CCryptoBoringSSLShims\include -I S:\b\8\swift S:\SourceCache\swift-crypto\Sources\CryptoBoringWrapper\AEAD\BoringSSLAEAD.swift S:\SourceCache\swift-crypto\Sources\CryptoBoringWrapper\CryptoKitErrors_boring.swift -Xlinker -implib:lib\CryptoBoringWrapper.lib -L S:\b\8\lib -L S:\b\8\lib -L S:\b\8\lib lib\CCryptoBoringSSL.lib lib\CCryptoBoringSSLShims.lib lib\CCryptoBoringSSL.lib && cd ."
S:\SourceCache\swift-crypto\Sources\CryptoBoringWrapper\AEAD\BoringSSLAEAD.swift:17:8: error: no such module 'Foundation'
import Foundation
^
I think this has to do with that Foundation is built in S:\b\103 rather than S:\b\1.
I bet you misunderstood something… The command set SDKROOT=
along is used to unset %SDKROOT%
from the environment, so any installed SDK will be transparent for the build system. There’s no need to set this variable when building Swift. Any required module, including Foundation
, will be handled by CMake directly.
Yes, I misunderstood. I did a full rebuild with the SDKROOT variable cleared but I got the same error as before.