Skip to content

[cmake] Bump minimum version to 3.4.3 #5113

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
Oct 19, 2016

Conversation

modocache
Copy link
Contributor

This pull request depends on #5112, which fixes warnings that are upgraded to errors in CMake 3.4.3. Please review that pull request before this one.

The Swift README states that the minimum CMake version required to build the Swift project is the same as LLVM's: 3.4.3. Bump the minimum version used by CMake to correspond to the README.

This addresses a suggestion left by @gottesmm and @llvm-beanz on #4999.

@rintaro
Copy link
Member

rintaro commented Oct 4, 2016

When I tried this once, IIRC, swift-remoteast-test target need ENABLE_EXPORTS to compile because of CMP0065:

set_target_properties(swift-remoteast-test PROPERTIES ENABLE_EXPORTS 1)

@modocache
Copy link
Contributor Author

Oh cool, thanks for the tip!

When I tried this once

Do you still have that code somewhere? I'd be happy to resurrect your pull request, as opposed to using this one. :)

@@ -8,12 +8,6 @@ if(POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)
endif()
Copy link
Member

Choose a reason for hiding this comment

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

Can't we remove all these cmake_policy definition?

https://cmake.org/cmake/help/v3.4/manual/cmake-policies.7.html

The cmake_minimum_required() command does more than report an error if a too-old version of CMake is used to build a project. It also sets all policies introduced in that CMake version or earlier to NEW behavior.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, cool! Done! Thanks!

@llvm-beanz
Copy link
Contributor

The LLVM_COMMON_DEPENDS part of this patch is actually hacking around a bug in LLVM's handling of LLVM_ENABLE_MODULES I would rather we didn't do that in Swift and instead fixed the bug in LLVM.

What is happening in LLVM is that when you set LLVM_ENABLE_MODULES=On intrinsics_gen gets added as a target of basically everything. That is done so that everything ends up depending on module generation. That is a hack. The bug you're seeing is that by putting intrinsics_gen in LLVM_COMMON_DEPENDS at the root CMakeLists file in LLVM it ends up getting written into the LLVMConfig.cmake export file. LLVM should never put anything in LLVM_COMMON_DEPENDS in the export file unless it is a target being exported. Since intrinsics_gen doesn't install any files, it doesn't exist in the exported targets.

I spoke with @vedantk about this last week. I'll circle back with him this morning, and we can get a fix into LLVM trunk and into swift-llvm this morning.

@rintaro
Copy link
Member

rintaro commented Oct 4, 2016

Code is here master...rintaro:cmake-3.4.3, that's all I modified :)
I don't have PR for this because I haven't tested this in macOS environment.

@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 - 6eab4159d5a2ec3a331d449d21bdb533c543c7ea
Test requested by - @modocache

The Swift README states that the minimum CMake version required to build the
Swift project is the same as LLVM's: 3.4.3. Bump the minimum version
used by CMake to correspond to the README.
@modocache
Copy link
Contributor Author

@swift-ci please clean test

@modocache
Copy link
Contributor Author

The builds passed! Can I get someone's stamp of approval on this, to bring our CMake into 3.4.3? 😍

Also, thanks to @rintaro -- this pull request is nearly exactly what he wrote in master...rintaro:cmake-3.4.3. 🙇

@gottesmm gottesmm merged commit 4c76f5f into swiftlang:master Oct 19, 2016
@modocache modocache deleted the cmake-3.4.3 branch October 20, 2016 01:33
@modocache
Copy link
Contributor Author

Whee! Thanks, @gottesmm!

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