Skip to content

[core] Update CMake to use TARGET_SDKS (NFC) #5004

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

Closed

Conversation

modocache
Copy link
Contributor

The add_swift_library CMake function takes an optional TARGET_SDKS parameter. When used, only CMake targets for the specified SDKs are added.

Refactor stdlib/public/core to use this parameter. This also eliminates logic that determines additional flags or source files to include based on CMAKE_SYSTEM_NAME, which makes it easier for hosts to add targets for different platforms.

This pull request was split out of #4972, which addresses SR-1362.

@modocache
Copy link
Contributor Author

@swift-ci Please clean test

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - 4e75a5d392ad27b32d60775cde846452eff39966
Test requested by - @modocache

@gottesmm
Copy link
Contributor

@shahmishal @jrose-apple Every time I have been trying to do a clean test, I have been running into the libdispatch issue that @modocache just ran into. What is the ETA for a fix for this problem? It is important that we have the ability to do clean builds to test cmake changes in a completely safe way.

@gottesmm
Copy link
Contributor

@modocache Btw, I am reviewing these while juggling a bunch of other things. If I don't respond in a week, please feel free to ping me. [I just want to be clear about that = )]

@jrose-apple
Copy link
Contributor

@erg is working on it.

@modocache
Copy link
Contributor Author

@gottesmm No problem! Also, I'm not entirely sure the Linux failure here is a CI failure. I do touch ICU linking in the patch, so it could be my fault. Booting my Linux VM to check as we speak. :)

@gottesmm
Copy link
Contributor

@modocache this is failing in the libdispatch build (unless I read the log wrong).

@modocache
Copy link
Contributor Author

Oh, yes, you're right. I was reading some unrelated output. :)

@modocache
Copy link
Contributor Author

@swift-ci Please test Linux platform

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - 4e75a5d392ad27b32d60775cde846452eff39966
Test requested by - @modocache

@gottesmm
Copy link
Contributor

@swift-ci Please clean test linux platform

@gottesmm
Copy link
Contributor

@modocache

@jrose-apple said that the libdispatch problem should be fixed.

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - 4e75a5d392ad27b32d60775cde846452eff39966
Test requested by - @gottesmm

@gottesmm
Copy link
Contributor

@jrose-apple @erg It looks like dispatch here is still broken.

@jrose-apple
Copy link
Contributor

Ah, I thought we were still talking about the macOS Dispatch issues. I don't know this one. @dgrove-oss?

The `add_swift_library` CMake function takes an optional `TARGET_SDKS`
parameter. When used, only CMake targets for the specified SDKs are added.

Refactor `stdlib/public/core` to use this parameter. This also eliminates
logic that determines additional flags or source files to include based on
`CMAKE_SYSTEM_NAME`, which makes it easier for hosts to add targets for
different platforms.

In addition, prevent libicu from being linked to object library
public/stdlib/stubs on Linux -- attempting to link libraries to object libraries
results in a CMake error.
@modocache modocache force-pushed the stdlib-core-cmake-target-sdks branch from 4e75a5d to c27d95d Compare September 30, 2016 19:05
@modocache
Copy link
Contributor Author

I think the errors were indeed related to libicu, not necessarily libdispatch. I uploaded a new patch that should address the issues. Thanks for your patience! :)

@modocache
Copy link
Contributor Author

@swift-ci Please clean test

@modocache
Copy link
Contributor Author

@gottesmm All good! Mind if I merge?

SWIFT_COMPILE_FLAGS ${swift_stdlib_compile_flags}
LINK_FLAGS ${swift_core_link_flags}
PRIVATE_LINK_LIBRARIES ${swift_core_private_link_libraries}
LINK_FLAGS ${swift_runtime_swift_gnu_link_flags} "${ENV_SYSTEMROOT}/system32/psapi.dll"
Copy link
Member

@compnerd compnerd Sep 30, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems odd. Why is psapi being linked explicitly here by path?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just moved this code, I didn't write this path out myself.

@modocache
Copy link
Contributor Author

@gottesmm Friendly ping! :)

@gottesmm
Copy link
Contributor

gottesmm commented Oct 2, 2016

I took a quick look at this. Overall, the patch is hard to read since you are re-organizing code as well as performing your actual change. Is it possible for you to do the code re-organization before or after this commit.

My reason for asking is that I want to be able to rubber stamp your commit as a simple change, but visually the noise is so large that I am not sure if I can do it without making a mistake/missing something.

@modocache
Copy link
Contributor Author

@gottesmm Gotcha, makes sense! I split off just the parts I need from this pull request into #5095. It doesn't include any of the rearranging. :)

@gottesmm
Copy link
Contributor

gottesmm commented Oct 3, 2016

Thanks! My brain appreciates it = ).

@modocache
Copy link
Contributor Author

Closing this in favor of #5095. Thanks for the feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants