Bump CMake requirement to 3.8.
CMake 3.8 was released April 10, 2017, which puts it past our five
year horizon. (CMake 3.9 is just a few days short of it, so using 3.8
for now.) In particular, depending on 3.7+ gets us some nice features
like VERSION_GREATER_EQUAL.
Change-Id: I90457ad41e7add3c6b2dd3664da964c4b6ede499
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/53345
Commit-Queue: Adam Langley <agl@google.com>
Auto-Submit: David Benjamin <davidben@google.com>
Reviewed-by: Adam Langley <agl@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 766c839..0864958 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.5)
+cmake_minimum_required(VERSION 3.8)
# Defer enabling C and CXX languages.
project(BoringSSL NONE)
@@ -160,7 +160,7 @@
set(C_CXX_FLAGS "${C_CXX_FLAGS} -Wno-free-nonheap-object")
endif()
- if(CLANG OR NOT "7.0.0" VERSION_GREATER CMAKE_C_COMPILER_VERSION)
+ if(CLANG OR CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "7.0.0")
set(C_CXX_FLAGS "${C_CXX_FLAGS} -Wimplicit-fallthrough")
endif()
@@ -406,10 +406,13 @@
function(go_executable dest package)
set(godeps "${CMAKE_SOURCE_DIR}/util/godeps.go")
- if(CMAKE_VERSION VERSION_LESS "3.7" OR NOT CMAKE_GENERATOR STREQUAL "Ninja")
- # The DEPFILE parameter to add_custom_command is new as of CMake 3.7 and
- # only works with Ninja. Query the sources at configure time. Additionally,
- # everything depends on go.mod. That affects what external packages to use.
+ if(NOT CMAKE_GENERATOR STREQUAL "Ninja")
+ # The DEPFILE parameter to add_custom_command only works with Ninja. Query
+ # the sources at configure time. Additionally, everything depends on go.mod.
+ # That affects what external packages to use.
+ #
+ # TODO(davidben): Starting CMake 3.20, it also works with Make. Starting
+ # 3.21, it works with Visual Studio and Xcode too.
execute_process(COMMAND ${GO_EXECUTABLE} run ${godeps} -format cmake
-pkg ${package}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}