Skip to content

Commit

Permalink
Bug #30332632 VISUAL STUDIO 2019 REQUIRES CMAKE 3.15
Browse files Browse the repository at this point in the history
There is a bug in msbuild for Visual Studio 2019. Custom command
dependencies are not handled correctly, and targets are re-built every
time.  Cmake 3.15 has a workaround, so add a minimal version check.

VS 2019 comes with a bundled cmake 3.14. If this is used, then ignore the
version check.

Change-Id: I87de73eb4c141ec80310546c727d295ac0f5d3b2
  • Loading branch information
Tor Didriksen committed Sep 25, 2019
1 parent 2599595 commit e7316a0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ MESSAGE(STATUS "Running cmake version ${CMAKE_VERSION}")
IF(WIN32)
# CMake 3.8.0 is needed for Visual Studio 2017 and x64 toolset.
CMAKE_MINIMUM_REQUIRED(VERSION 3.8.0)
IF(CMAKE_GENERATOR MATCHES "Visual Studio" AND CMAKE_GENERATOR MATCHES "2019")
IF(CMAKE_VERSION MATCHES "MSVC")
# It is the bundled version, ignore version check,
# (although this seems to be buggy too).
ELSE()
# Bug in msbuild, install the latest in the 3.15 series as a workaround.
# https://gitlab.kitware.com/cmake/cmake/issues/19303
# custom commands are re-built every time
CMAKE_MINIMUM_REQUIRED(VERSION 3.15.3)
ENDIF()
ENDIF()
ELSEIF(APPLE)
# Version 3.12.4 is needed because the new build system of Xcode is not
# supported by cmake. 3.12.4 will force using the legacy build system.
Expand Down

0 comments on commit e7316a0

Please sign in to comment.