From f0a0f3dcb42ee249d7ba0c09e674900adfb9ea2e Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 13 Jun 2014 11:08:34 +0200 Subject: [PATCH] WCDH: Fix compiler id test for compatibility macros. Enable the alignment features for Clang. --- Modules/WriteCompilerDetectionHeader.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake index fb0dda100..593176c91 100644 --- a/Modules/WriteCompilerDetectionHeader.cmake +++ b/Modules/WriteCompilerDetectionHeader.cmake @@ -428,7 +428,7 @@ function(write_compiler_detection_header set(file_content "${file_content} # if ${def_name} # define ${def_value} alignas(X) -# elif ${prefix_arg}_COMPILER_IS_GNU +# elif ${prefix_arg}_COMPILER_IS_GNU || ${prefix_arg}_COMPILER_IS_Clang # define ${def_value} __attribute__ ((__aligned__(X))) # else # define ${def_value} @@ -440,7 +440,7 @@ function(write_compiler_detection_header set(file_content "${file_content} # if ${def_name} # define ${def_value} alignof(X) -# elif ${prefix_arg}_COMPILER_IS_GNU +# elif ${prefix_arg}_COMPILER_IS_GNU || ${prefix_arg}_COMPILER_IS_Clang # define ${def_value} __alignof__(X) # endif \n") @@ -495,10 +495,10 @@ function(write_compiler_detection_header # if ${def_name} # define ${def_value} [[deprecated]] # define ${def_value}_MSG(MSG) [[deprecated(MSG)]] -# elif defined(__GNUC__) || defined(__clang__) +# elif ${prefix_arg}_COMPILER_IS_GNU || ${prefix_arg}_COMPILER_IS_Clang # define ${def_value} __attribute__((__deprecated__)) # define ${def_value}_MSG(MSG) __attribute__((__deprecated__(MSG))) -# elif defined(_MSC_VER) +# elif ${prefix_arg}_COMPILER_IS_MSVC # define ${def_value} __declspec(deprecated) # define ${def_value}_MSG(MSG) __declspec(deprecated(MSG)) # else