summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler/Clang-CXX.cmake
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-09-22 20:13:15 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-09-22 20:13:15 (GMT)
commitd13758514cd69ac10e5351f2a56b5706df6a3a78 (patch)
tree8274e84a02cb267fc7ee94b04d6e81889bfd914c /Modules/Compiler/Clang-CXX.cmake
parent442d17ef6c50a3ffc83ed6a860dc05febd85f1b4 (diff)
downloadCMake-d13758514cd69ac10e5351f2a56b5706df6a3a78.zip
CMake-d13758514cd69ac10e5351f2a56b5706df6a3a78.tar.gz
CMake-d13758514cd69ac10e5351f2a56b5706df6a3a78.tar.bz2
Project: Don't require computed default dialect if compiler was forced.
Commit 7235334a (Project: Determine default language dialect for the compiler., 2015-09-15) introduced a mechanism to determine the default dialect used for the running compiler. If conditions in the <CompilerId>-<Lang>.cmake file are such that compile features for that version of the compiler should be supported, the _DEFAULT_STANDARD is set to the computed value. However, the CMakeForceCompiler module allows users to bypass execution of the compiler by CMake. In that case, do not set the _DEFAULT_STANDARD variable at all, which effectively disables the compile-features where the module is used. No compile features have ever been recorded where the module is used so no functionality is lost.
Diffstat (limited to 'Modules/Compiler/Clang-CXX.cmake')
-rw-r--r--Modules/Compiler/Clang-CXX.cmake8
1 files changed, 5 insertions, 3 deletions
diff --git a/Modules/Compiler/Clang-CXX.cmake b/Modules/Compiler/Clang-CXX.cmake
index fcc7319..055a8ee 100644
--- a/Modules/Compiler/Clang-CXX.cmake
+++ b/Modules/Compiler/Clang-CXX.cmake
@@ -32,10 +32,12 @@ elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4)
endif()
if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4)
- if (NOT CMAKE_CXX_STANDARD_COMPUTED_DEFAULT)
- message(FATAL_ERROR "CMAKE_CXX_STANDARD_COMPUTED_DEFAULT should be set for ${CMAKE_CXX_COMPILER_ID} (${CMAKE_CXX_COMPILER}) version ${CMAKE_CXX_COMPILER_VERSION}")
+ if (NOT CMAKE_CXX_COMPILER_FORCED)
+ if (NOT CMAKE_CXX_STANDARD_COMPUTED_DEFAULT)
+ message(FATAL_ERROR "CMAKE_CXX_STANDARD_COMPUTED_DEFAULT should be set for ${CMAKE_CXX_COMPILER_ID} (${CMAKE_CXX_COMPILER}) version ${CMAKE_CXX_COMPILER_VERSION}")
+ endif()
+ set(CMAKE_CXX_STANDARD_DEFAULT ${CMAKE_CXX_STANDARD_COMPUTED_DEFAULT})
endif()
- set(CMAKE_CXX_STANDARD_DEFAULT ${CMAKE_CXX_STANDARD_COMPUTED_DEFAULT})
endif()
macro(cmake_record_cxx_compile_features)