Skip to content

Threading library munges all backends into a single build #77435

Open
@etcwilde

Description

@etcwilde

Description

The Threading runtime library currently builds all of the threading runtimes into a single library, using macros inside of the files to mask out the contents of the source file resulting in the library containing several empty objects and a single object with actual content. While it "works", this is kind of gross. It would be better if the build selected the appropriate file and only built the one file.

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/modules")
include(AddSwiftStdlib)
# This should *not* include ThreadSanitizer.cpp, as that is part of libswiftCore
add_swift_target_library(swiftThreading OBJECT_LIBRARY
"${SWIFT_SOURCE_DIR}/lib/Threading/C11.cpp"
"${SWIFT_SOURCE_DIR}/lib/Threading/Linux.cpp"
"${SWIFT_SOURCE_DIR}/lib/Threading/Pthreads.cpp"
"${SWIFT_SOURCE_DIR}/lib/Threading/Win32.cpp"
INSTALL_IN_COMPONENT never_install)

Additional information

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions