summaryrefslogtreecommitdiff
path: root/Modules/Compiler/AppleClang-CXX.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-11-30 15:15:05 -0500
committerBrad King <brad.king@kitware.com>2016-12-02 11:22:43 -0500
commit684e4d205d64ff8b98c00a1d6a358bffbf509c62 (patch)
tree55e5ba78f5658823eda8d299e671bdec7f14b412 /Modules/Compiler/AppleClang-CXX.cmake
parentf2035cbd0d631698ec911e72d0d857fd32d2db7a (diff)
downloadcmake-684e4d205d64ff8b98c00a1d6a358bffbf509c62.tar.gz
Features: Make feature recording conditions more consistent
Condition all calls to `_record_compiler_features_{c,cxx}` on `_result EQUAL 0` so that adding new language standards later does not need to update them. Avoid some duplicate compiler version checks by conditioning C11 and CXX14 feature recording on the existence of `CMAKE_{C11,CXX14}_STANDARD_COMPILE_OPTION` (whose setting already used the version check).
Diffstat (limited to 'Modules/Compiler/AppleClang-CXX.cmake')
-rw-r--r--Modules/Compiler/AppleClang-CXX.cmake3
1 files changed, 1 insertions, 2 deletions
diff --git a/Modules/Compiler/AppleClang-CXX.cmake b/Modules/Compiler/AppleClang-CXX.cmake
index 8dd62784c4..afb9affea2 100644
--- a/Modules/Compiler/AppleClang-CXX.cmake
+++ b/Modules/Compiler/AppleClang-CXX.cmake
@@ -38,8 +38,7 @@ endif()
macro(cmake_record_cxx_compile_features)
set(_result 0)
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.0)
- set(_result 0)
- if(CMAKE_CXX14_STANDARD_COMPILE_OPTION)
+ if(_result EQUAL 0 AND CMAKE_CXX14_STANDARD_COMPILE_OPTION)
_record_compiler_features_cxx(14)
endif()
if (_result EQUAL 0)