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
3 changes: 0 additions & 3 deletions Sources/SWBCore/SWBFeatureFlag.swift
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,6 @@ public enum SWBFeatureFlag {
/// Remove this feature flag after landing rdar://104894978 (Write "perform-ownership-analysis" = "yes" to build manifest by default)
public static let performOwnershipAnalysis = SWBFeatureFlagProperty("PerformOwnershipAnalysis", defaultValue: false)

/// Enable clang explicit modules by default.
public static let enableClangExplicitModulesByDefault = SWBFeatureFlagProperty("EnableClangExplicitModulesByDefault", defaultValue: false)

/// Enable Swift explicit modules by default.
public static let enableSwiftExplicitModulesByDefault = SWBFeatureFlagProperty("EnableSwiftExplicitModulesByDefault", defaultValue: false)

Expand Down
4 changes: 0 additions & 4 deletions Sources/SWBCore/Settings/Settings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -573,10 +573,6 @@ final class WorkspaceSettings: Sendable {
table.push(BuiltinMacros.EXPERIMENTAL_ALLOW_INSTALL_HEADERS_FILTERING, literal: true)
}

if SWBFeatureFlag.enableClangExplicitModulesByDefault.value {
table.push(BuiltinMacros.CLANG_ENABLE_EXPLICIT_MODULES, literal: true)
}

if SWBFeatureFlag.enableSwiftExplicitModulesByDefault.value {
table.push(BuiltinMacros.SWIFT_ENABLE_EXPLICIT_MODULES, literal: .enabled)
}
Expand Down
9 changes: 5 additions & 4 deletions Sources/SWBCore/SpecImplementations/Tools/CCompiler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -967,12 +967,13 @@ public class ClangCompilerSpec : CompilerSpec, SpecIdentifierType, GCCCompatible

// If not defined, try to find one from the toolchain.
var candidatesSkipped: [Path] = []
for (toolchainPath, toolchainLibrarySearchPath) in cbc.producer.toolchains.map({ ($0.path, $0.librarySearchPaths) }) {
if let path = toolchainLibrarySearchPath.findLibrary(operatingSystem: cbc.producer.hostOperatingSystem, basename: "clang") {
for toolchain in cbc.producer.toolchains {
if let path = try? toolchain.lookup(subject: .library(basename: "clang"), operatingSystem: cbc.producer.hostOperatingSystem) {
// Check that this is the same toolchain and version as the compiler. Mismatched clang/libclang is not supported with explicit modules.
let compilerAndLibraryAreInSameToolchain = toolchainPath.isAncestor(of: compiler)
let compilerAndLibraryAreInSameToolchain = toolchain.path.isAncestor(of: compiler)
let libclangVersion = cbc.producer.lookupLibclang(path: path).version
let compilerAndLibraryVersionsMatch = libclangVersion != nil && libclangVersion == clangInfo?.clangVersion
// On macOS we enforce a matching clang and libclang version, the versioning schemes on other host platforms currently make this difficult.
let compilerAndLibraryVersionsMatch = libclangVersion != nil && libclangVersion == clangInfo?.clangVersion || cbc.producer.hostOperatingSystem != .macOS
if compilerAndLibraryAreInSameToolchain && (compilerAndLibraryVersionsMatch || cbc.scope.evaluate(BuiltinMacros.CLANG_EXPLICIT_MODULES_IGNORE_LIBCLANG_VERSION_MISMATCH)) {
return path
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/SWBWindowsPlatform/Specs/WindowsCompile.xcspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
Type = Compiler;
BasedOn = "default:com.apple.compilers.llvm.clang.1_0";
EnvironmentVariables = {
"TEMP" = "$(OBJROOT)";
"TMP" = "$(OBJROOT)";
"TEMP" = "$(CACHE_ROOT:default=$(OBJROOT))";
"TMP" = "$(CACHE_ROOT:default=$(OBJROOT))";
};
Name = "Apple LLVM Windows";
Description = "Apple LLVM Windows compiler";
Expand Down
Loading