summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler/MSVC-CXX.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-06-01 17:40:03 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-06-01 17:40:47 (GMT)
commit860db083cafb1337147923f7dd21b57767abbee3 (patch)
treefea1a13e782087d9699998de11a2f321769c2103 /Modules/Compiler/MSVC-CXX.cmake
parentc80148c77e552a43b0648bad02de86e6b6d2b61d (diff)
parent3c1ecb5214afa45a44742ad2b1e24517925e858a (diff)
downloadCMake-860db083cafb1337147923f7dd21b57767abbee3.zip
CMake-860db083cafb1337147923f7dd21b57767abbee3.tar.gz
CMake-860db083cafb1337147923f7dd21b57767abbee3.tar.bz2
Merge topic 'add-common-record-features-macros'
3c1ecb52 Intel: Fix missing C std default for 12.0 <= ver < 12.1 f70b0bb3 SunPro: Make sure all known versions get CXX98 defaults 220ede74 GNU: Fix language defaults for 3.4 a40e6ba8 Clang: Fix language defaults for 2.1 9b112a84 Compilers: Port to use default cmake_record_lang_compile_features macros 37221529 MSVC: Add empty definitions for std compile options e556f1b9 CompileFeatures: Makes tests work with meta-feature only 20ffa147 Tests: Allow test macro to take no executable arguments ... Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !833
Diffstat (limited to 'Modules/Compiler/MSVC-CXX.cmake')
-rw-r--r--Modules/Compiler/MSVC-CXX.cmake32
1 files changed, 18 insertions, 14 deletions
diff --git a/Modules/Compiler/MSVC-CXX.cmake b/Modules/Compiler/MSVC-CXX.cmake
index 8fcfa0f..9371301 100644
--- a/Modules/Compiler/MSVC-CXX.cmake
+++ b/Modules/Compiler/MSVC-CXX.cmake
@@ -1,17 +1,21 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
-if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16.0)
- # MSVC has no specific language level or flags to change it.
+include(Compiler/CMakeCommonCompilerMacros)
+
+if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0)
+ # MSVC has no specific options to set language standards, but set them as
+ # empty strings anyways so the feature test infrastructure can at least check
+ # to see if they are defined.
+ set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "")
+ set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "")
+ set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "")
+ set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "")
+ set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "")
+ set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "")
+ set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "")
+ set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "")
+
+ # There is no meaningful default for this
set(CMAKE_CXX_STANDARD_DEFAULT "")
endif()
-
-macro(cmake_record_cxx_compile_features)
- if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16.0)
- list(APPEND CMAKE_CXX_COMPILE_FEATURES
- cxx_std_98
- cxx_std_11
- cxx_std_14
- cxx_std_17
- )
- _record_compiler_features(CXX "" CMAKE_CXX_COMPILE_FEATURES)
- endif()
-endmacro()