Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions __tests__/installer/windows.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ describe('windows toolchain installation verification', () => {
'SDKs',
'Windows.sdk'
)
const swiftLibs = path.join(sdkroot, 'usr', 'lib', 'swift')
const swiftPath = path.join(toolPath, 'usr', 'bin')
const swiftDev = path.join(installation, 'Swift-development', 'bin')
const icu67 = path.join(installation, 'icu-67', 'usr', 'bin')
Expand All @@ -192,6 +193,11 @@ describe('windows toolchain installation verification', () => {
expect(process.env.PATH?.includes(swiftDev)).toBeTruthy()
expect(process.env.PATH?.includes(icu67)).toBeTruthy()
expect(process.env.SDKROOT).toBe(sdkroot)
expect(process.env.SWIFTFLAGS).toContain(`-sdk ${sdkroot}`)
expect(process.env.SWIFTFLAGS).toContain(`-I ${swiftLibs}`)
expect(process.env.SWIFTFLAGS).toContain(
`-L ${path.join(swiftLibs, 'windows')}`
)
})

it('tests installation with cache', async () => {
Expand Down
14 changes: 11 additions & 3 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 11 additions & 3 deletions src/installer/windows/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ export class WindowsToolchainInstaller extends VerifyingToolchainInstaller<Windo
if (!installation) {
return
}
core.exportVariable('SDKROOT', installation.sdkroot)
const sdkroot = installation.sdkroot
core.exportVariable('SDKROOT', sdkroot)
if (installation.devdir) {
core.exportVariable('DEVELOPER_DIR', installation.devdir)
}
Expand All @@ -71,8 +72,15 @@ export class WindowsToolchainInstaller extends VerifyingToolchainInstaller<Windo
}
core.debug(`Swift installed at "${swiftPath}"`)
const visualStudio = await VisualStudio.setup(this.vsRequirement)
await visualStudio.update(installation.sdkroot)
const swiftFlags = `-sdk %SDKROOT% -I %SDKROOT%/usr/lib/swift -L %SDKROOT%/usr/lib/swift/windows`
await visualStudio.update(sdkroot)
const swiftFlags = [
'-sdk',
sdkroot,
'-I',
path.join(sdkroot, 'usr', 'lib', 'swift'),
'-L',
path.join(sdkroot, 'usr', 'lib', 'swift', 'windows')
].join(' ')
core.exportVariable('SWIFTFLAGS', swiftFlags)
}
}
Loading