Skip to content

Commit af0ad46

Browse files
committed
Fix -fmodule-map-file pointing to non-existent path
We were passing this unconditionally which would break in the case where we weren't generated a module map because an explicit one exists. rdar://74115399
1 parent 543f9b0 commit af0ad46

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Sources/XCBuildSupport/PIFBuilder.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,9 @@ final class PackagePIFProjectBuilder: PIFProjectBuilder {
583583
export *
584584
}
585585
"""
586+
587+
// Pass the path of the module map up to all direct and indirect clients.
588+
impartedSettings[.OTHER_CFLAGS, default: ["$(inherited)"]].append("-fmodule-map-file=\(moduleMapFile)")
586589
} else {
587590
moduleMapFileContents = nil
588591
}
@@ -607,8 +610,6 @@ final class PackagePIFProjectBuilder: PIFProjectBuilder {
607610
settings[.MODULEMAP_FILE_CONTENTS] = moduleMapFileContents
608611
}
609612

610-
// Pass the path of the module map up to all direct and indirect clients.
611-
impartedSettings[.OTHER_CFLAGS, default: ["$(inherited)"]].append("-fmodule-map-file=\(moduleMapFile)")
612613
impartedSettings[.OTHER_LDRFLAGS] = []
613614

614615
if target.underlyingTarget.isCxx {

0 commit comments

Comments
 (0)