Skip to content

Commit e7316a0

Browse files
author
Tor Didriksen
committed
Bug #30332632 VISUAL STUDIO 2019 REQUIRES CMAKE 3.15
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
1 parent 2599595 commit e7316a0

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,17 @@ MESSAGE(STATUS "Running cmake version ${CMAKE_VERSION}")
2525
IF(WIN32)
2626
# CMake 3.8.0 is needed for Visual Studio 2017 and x64 toolset.
2727
CMAKE_MINIMUM_REQUIRED(VERSION 3.8.0)
28+
IF(CMAKE_GENERATOR MATCHES "Visual Studio" AND CMAKE_GENERATOR MATCHES "2019")
29+
IF(CMAKE_VERSION MATCHES "MSVC")
30+
# It is the bundled version, ignore version check,
31+
# (although this seems to be buggy too).
32+
ELSE()
33+
# Bug in msbuild, install the latest in the 3.15 series as a workaround.
34+
# https://gitlab.kitware.com/cmake/cmake/issues/19303
35+
# custom commands are re-built every time
36+
CMAKE_MINIMUM_REQUIRED(VERSION 3.15.3)
37+
ENDIF()
38+
ENDIF()
2839
ELSEIF(APPLE)
2940
# Version 3.12.4 is needed because the new build system of Xcode is not
3041
# supported by cmake. 3.12.4 will force using the legacy build system.

0 commit comments

Comments
 (0)