Skip to content
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

[cmake] Enable IN_LIST compare policy #4999

Merged
merged 1 commit into from
Sep 29, 2016

Conversation

modocache
Copy link
Contributor

Enable CMake policy CMP0057, which allows if() statements to use the IN_LIST operator. In addition, simplify several if() statements that used the list(FIND ...) operation instead.

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

@llvm-beanz
Copy link
Contributor

Given that LLVM requires CMake 3.4.3 which has this by default wouldn't it be better to just raise Swift's CMake minimum version to 3.4.3 instead of setting the policy?

@gottesmm
Copy link
Contributor

@llvm-beanz We do require cmake 3.4.3. Just no one has gotten around to changing the actual requirement in source b/c of potential policy differences.

Maybe that is the right fix here?

@modocache
Copy link
Contributor Author

modocache commented Sep 24, 2016

I'd love to do so, but perhaps in a separate commit? In that future commit I could remove the cmake_policy(SET CMP0057 NEW) and bump the minimum version, leaving the IN_LIST changes alone. I'd prefer a future commit because bumping the minimum version leads to errors that I have yet to figure out.

@llvm-beanz
Copy link
Contributor

@modocache, sounds reasonable to me.

@gottesmm
Copy link
Contributor

@llvm-beanz @modocache Also SGTM

@gottesmm
Copy link
Contributor

With that being said:

@swift-ci Please test

@gottesmm
Copy link
Contributor

Hmmm... I actually wanted to do a clean cmake build.

@gottesmm
Copy link
Contributor

@swift-ci Please clean test

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - 8cffc57d7db36261d663e39196165f1f85da7b36
Test requested by - @gottesmm

@gottesmm
Copy link
Contributor

Interesting. Libdispatch failed probably due to dependency race issues.

@gottesmm
Copy link
Contributor

@swift-ci Please clean test os x platform

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - 8cffc57d7db36261d663e39196165f1f85da7b36
Test requested by - @gottesmm

@modocache
Copy link
Contributor Author

@swift-ci Please clean test os x platform

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - 8cffc57d7db36261d663e39196165f1f85da7b36
Test requested by - @modocache

@modocache
Copy link
Contributor Author

@swift-ci please test os x platform

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - 8cffc57d7db36261d663e39196165f1f85da7b36
Test requested by - @modocache

@modocache
Copy link
Contributor Author

@swift-ci please test os x platform

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - 8cffc57d7db36261d663e39196165f1f85da7b36
Test requested by - @modocache

@modocache
Copy link
Contributor Author

@swift-ci please test

@modocache
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - b296a735b46d8de0934fadf5f92412b7c84302e7
Test requested by - @modocache

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - 8cffc57d7db36261d663e39196165f1f85da7b36
Test requested by - @modocache

@modocache
Copy link
Contributor Author

Hmm, I'm pretty baffled here. Running the exact same preset on my macOS machine succeeds. I don't understand where these Dispatch SDK overlay errors are coming from. Does anyone have any tips?

@gottesmm
Copy link
Contributor

@jrose-apple This sounds like something up your alley.

@modocache
Copy link
Contributor Author

For what it's worth, I have Xcode 8.0 (8A218a) installed, on macOS Sierra 10.12.

@@ -618,8 +618,7 @@ function(_add_swift_library_single target name)
else()
string(REPLACE swift "" module_name "${name}")
endif()
list(FIND SWIFT_API_NOTES_INPUTS "${module_name}" overlay_index)
if(NOT ${overlay_index} EQUAL -1)
if("${modue_name}" IN_LIST SWIFT_API_NOTES_INPUTS)
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo: missing "l". :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is why I love CMake. Thanks, @jrose-apple! ❤️

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And sure enough, a completely clean build did reproduce this on my macOS machine. Geez! 😬

Enable CMake policy CMP0057, which allows `if()` statements to use the `IN_LIST`
operator. In addition, simplify several `if()` statements that used the
`list(FIND ...)` operation instead.
@modocache
Copy link
Contributor Author

@swift-ci Please test

@modocache
Copy link
Contributor Author

OK, this finally seems good to merge. Look OK to you, @gottesmm?

@modocache
Copy link
Contributor Author

Alright, I'm too excited for #4972 to let this wait for very long, so I'm going to go ahead and merge this. Sorry in advance if some of the buildbots fail due to incorrect CMake caches... 😇

/cc @tfiala 🙇

@modocache modocache merged commit 7fbf501 into swiftlang:master Sep 29, 2016
@modocache modocache deleted the cmake-in-list branch September 29, 2016 19:45
@gottesmm
Copy link
Contributor

No worries. LGTM.

@gottesmm
Copy link
Contributor

I actually reviewed it on the bus, but the bus reached the destination. Sorry!

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.

6 participants