Skip to content

Some C++ packages fail to build on Apple platforms #7267

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 18, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,10 @@ public final class ClangTargetBuildDescription {
// Swift is able to use modules on non-Darwin platforms because it injects its own module maps
// via vfs. However, nothing does that for C based compilation, and so non-Darwin platforms can't
// support clang modules.
// Note that if modules get enabled for other platforms later, we'll need to verify that
// https://github.com/llvm/llvm-project/issues/55980 (crash on C++17 and later) is fixed, or don't
// enable modules in the affected modes.
let enableModules = triple.isDarwin()
// Note that if modules get enabled for other platforms later, they can't be used with C++ until
// https://github.com/llvm/llvm-project/issues/55980 (crash on C++17 and later) is fixed.
// clang modules aren't fully supported in C++ mode in the current Darwin SDKs.
let enableModules = triple.isDarwin() && !isCXX
if enableModules {
args += ["-fmodules", "-fmodule-name=" + target.c99name]
}
Expand Down
14 changes: 7 additions & 7 deletions Tests/BuildTests/BuildPlanTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2889,14 +2889,14 @@ final class BuildPlanTests: XCTestCase {
var expectedLibBasicArgs = triple.isDarwin() ? ["-fobjc-arc"] : []
expectedLibBasicArgs += ["-target", defaultTargetTriple]
expectedLibBasicArgs += ["-O0", "-DSWIFT_PACKAGE=1", "-DDEBUG=1", "-fblocks"]
let shouldHaveModules = triple.isDarwin()
if shouldHaveModules {
expectedLibBasicArgs += ["-fmodules", "-fmodule-name=lib"]
}
// let shouldHaveModules = false // FIXME(5473) - support modules on non-Apple platforms, and also for C++ on any platform
// if shouldHaveModules {
// expectedLibBasicArgs += ["-fmodules", "-fmodule-name=lib"]
// }
expectedLibBasicArgs += ["-I", Pkg.appending(components: "Sources", "lib", "include").pathString]
if shouldHaveModules {
expectedLibBasicArgs += ["-fmodules-cache-path=\(buildPath.appending(components: "ModuleCache"))"]
}
// if shouldHaveModules {
// expectedLibBasicArgs += ["-fmodules-cache-path=\(buildPath.appending(components: "ModuleCache"))"]
// }
expectedLibBasicArgs += [
triple.isWindows() ? "-gdwarf" : "-g",
triple.isWindows() ? "-gdwarf" : "-g",
Expand Down