diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-01-17 13:10:26 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-01-17 13:48:27 (GMT) |
commit | d84d6ed409c663573a02efa7d2692b6829d27c46 (patch) | |
tree | d3877536b8c849e398e9392668a60021ca19d25c | |
parent | 7dcdfec97fdefa90bded7868a638277d7c9903f1 (diff) | |
download | CMake-d84d6ed409c663573a02efa7d2692b6829d27c46.zip CMake-d84d6ed409c663573a02efa7d2692b6829d27c46.tar.gz CMake-d84d6ed409c663573a02efa7d2692b6829d27c46.tar.bz2 |
WCDH: Allow compilers to specify features for one language but not the other.
-rw-r--r-- | Modules/WriteCompilerDetectionHeader.cmake | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake index 0464e66..d9ab9fb 100644 --- a/Modules/WriteCompilerDetectionHeader.cmake +++ b/Modules/WriteCompilerDetectionHeader.cmake @@ -386,6 +386,13 @@ function(write_compiler_detection_header endif() foreach(_lang ${_langs}) + set(target_compilers) + foreach(compiler ${_WCD_COMPILERS}) + _load_compiler_variables(${compiler} ${_lang} ${${_lang}_features}) + if(_cmake_oldestSupported_${compiler}) + list(APPEND target_compilers ${compiler}) + endif() + endforeach() get_property(known_features GLOBAL PROPERTY CMAKE_${_lang}_KNOWN_FEATURES) foreach(feature ${${_lang}_features}) @@ -408,8 +415,7 @@ function(write_compiler_detection_header set(file_content "${file_content}${ID_CONTENT}\n") set(pp_if "if") - foreach(compiler ${_WCD_COMPILERS}) - _load_compiler_variables(${compiler} ${_lang} ${${_lang}_features}) + foreach(compiler ${target_compilers}) set(file_content "${file_content}\n# ${pp_if} ${prefix_arg}_COMPILER_IS_${compiler}\n") if(_WCD_OUTPUT_FILES_VAR) |