Skip to content

Commit db117d2

Browse files
authored
Merge pull request #856 from owenv/owenv/clang-ebm-cleanup
Remove old feature enablement default
2 parents a9fcbcd + e115b73 commit db117d2

File tree

5 files changed

+46
-54
lines changed

5 files changed

+46
-54
lines changed

Sources/SWBCore/SWBFeatureFlag.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,6 @@ public enum SWBFeatureFlag {
141141
/// Remove this feature flag after landing rdar://104894978 (Write "perform-ownership-analysis" = "yes" to build manifest by default)
142142
public static let performOwnershipAnalysis = SWBFeatureFlagProperty("PerformOwnershipAnalysis", defaultValue: false)
143143

144-
/// Enable clang explicit modules by default.
145-
public static let enableClangExplicitModulesByDefault = SWBFeatureFlagProperty("EnableClangExplicitModulesByDefault", defaultValue: false)
146-
147144
/// Enable Swift explicit modules by default.
148145
public static let enableSwiftExplicitModulesByDefault = SWBFeatureFlagProperty("EnableSwiftExplicitModulesByDefault", defaultValue: false)
149146

Sources/SWBCore/Settings/Settings.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -573,10 +573,6 @@ final class WorkspaceSettings: Sendable {
573573
table.push(BuiltinMacros.EXPERIMENTAL_ALLOW_INSTALL_HEADERS_FILTERING, literal: true)
574574
}
575575

576-
if SWBFeatureFlag.enableClangExplicitModulesByDefault.value {
577-
table.push(BuiltinMacros.CLANG_ENABLE_EXPLICIT_MODULES, literal: true)
578-
}
579-
580576
if SWBFeatureFlag.enableSwiftExplicitModulesByDefault.value {
581577
table.push(BuiltinMacros.SWIFT_ENABLE_EXPLICIT_MODULES, literal: .enabled)
582578
}

Sources/SWBCore/SpecImplementations/Tools/CCompiler.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -967,12 +967,13 @@ public class ClangCompilerSpec : CompilerSpec, SpecIdentifierType, GCCCompatible
967967

968968
// If not defined, try to find one from the toolchain.
969969
var candidatesSkipped: [Path] = []
970-
for (toolchainPath, toolchainLibrarySearchPath) in cbc.producer.toolchains.map({ ($0.path, $0.librarySearchPaths) }) {
971-
if let path = toolchainLibrarySearchPath.findLibrary(operatingSystem: cbc.producer.hostOperatingSystem, basename: "clang") {
970+
for toolchain in cbc.producer.toolchains {
971+
if let path = try? toolchain.lookup(subject: .library(basename: "clang"), operatingSystem: cbc.producer.hostOperatingSystem) {
972972
// Check that this is the same toolchain and version as the compiler. Mismatched clang/libclang is not supported with explicit modules.
973-
let compilerAndLibraryAreInSameToolchain = toolchainPath.isAncestor(of: compiler)
973+
let compilerAndLibraryAreInSameToolchain = toolchain.path.isAncestor(of: compiler)
974974
let libclangVersion = cbc.producer.lookupLibclang(path: path).version
975-
let compilerAndLibraryVersionsMatch = libclangVersion != nil && libclangVersion == clangInfo?.clangVersion
975+
// On macOS we enforce a matching clang and libclang version, the versioning schemes on other host platforms currently make this difficult.
976+
let compilerAndLibraryVersionsMatch = libclangVersion != nil && libclangVersion == clangInfo?.clangVersion || cbc.producer.hostOperatingSystem != .macOS
976977
if compilerAndLibraryAreInSameToolchain && (compilerAndLibraryVersionsMatch || cbc.scope.evaluate(BuiltinMacros.CLANG_EXPLICIT_MODULES_IGNORE_LIBCLANG_VERSION_MISMATCH)) {
977978
return path
978979
}

Sources/SWBWindowsPlatform/Specs/WindowsCompile.xcspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
Type = Compiler;
1818
BasedOn = "default:com.apple.compilers.llvm.clang.1_0";
1919
EnvironmentVariables = {
20-
"TEMP" = "$(OBJROOT)";
21-
"TMP" = "$(OBJROOT)";
20+
"TEMP" = "$(CACHE_ROOT:default=$(OBJROOT))";
21+
"TMP" = "$(CACHE_ROOT:default=$(OBJROOT))";
2222
};
2323
Name = "Apple LLVM Windows";
2424
Description = "Apple LLVM Windows compiler";

0 commit comments

Comments
 (0)