-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Cmake] Add Synchronization #80841
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
base: main
Are you sure you want to change the base?
[Cmake] Add Synchronization #80841
Conversation
set(${PROJECT_NAME}_SWIFTC_SOURCE_DIR | ||
"${PROJECT_SOURCE_DIR}/../../../" | ||
CACHE FILEPATH "Path to the root source directory of the Swift compiler") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you reference anything from there? I think that we should just drop this if possible. The supplemental libraries don't tend to reach into the sources of the core libraries AFAIK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*gyb enters chat*
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though, for the purposes of the supplemental libraries, the gyb module should probably reach up into the compiler bits so that each of the supplemental projects don't need to explicitly.
|
||
add_compile_options( | ||
$<$<COMPILE_LANGUAGE:Swift>:-explicit-module-build> | ||
$<$<COMPILE_LANGUAGE:Swift>:-enable-builtin-module> # Are these contradictory? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which options does the comment refer to? I don't see any contradictory options.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@compnerd it was for
It was mainly a note for myself to confirm I needed both of those compiler flags as I wasn't sure if they contradicted each other. Evan answered my question below
@@ -0,0 +1,47 @@ | |||
find_package(Python3 REQUIRED COMPONENTS Interpreter) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a copy from the core libraries gyb implementation? It really is unfortunate that we do not have a Runtimes/cmake/modules
to share some of these through.
@etcwilde - what do you think of creating that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, it's a copy in the same way we have AvailabilityMacros
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been doing my best to prevent cross-pollination between the layers.
Worried about folks trying to be overly DRY and ending up with another umbrella add_swift_target_library
function with 97 arguments.
|
||
add_compile_options( | ||
$<$<COMPILE_LANGUAGE:Swift>:-explicit-module-build> | ||
$<$<COMPILE_LANGUAGE:Swift>:-enable-builtin-module> # Are these contradictory? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These don't conflict. explicit module builds affect how the driver looks up modules, while builtin-module
allows libraries that are not part of the core Swift
module to use builtins. It's not for use outside of the distribution of standard libraries, but everything in Supplemental is part of that distribution so it's fine.
|
||
install(TARGETS swiftSynchronization | ||
EXPORT SwiftSupplementalTargets | ||
COMPONENT SwiftCore_runtime |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems a remnant from the reference code in SwiftCore -- maybe we can use the project name directly
COMPONENT SwiftCore_runtime | |
COMPONENT ${PROJECT_NAME} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Namespacing the component with the project name is good. Let's keep the _runtime
suffix since this is only installing the runtime library. This will make it easier to split up the install story for different use cases.
Add the Synchronization supplemental library
Built atop some of the changes from #80513