[cmake-developers] CheckStructHasMember does not support C++ only structs
Brad King
brad.king at kitware.com
Mon Sep 23 11:50:57 EDT 2013
On 09/23/2013 04:27 AM, Daniele E. Domenichelli wrote:
> The attached patch adds 2 new macros:
> - CHECK_CXX_STRUCT_HAS_MEMBER (similar to CHECK_STRUCT_HAS_MEMBER but
> uses the C++ compiler)
> - CHECK_C_STRUCT_HAS_MEMBER (identical to CHECK_STRUCT_HAS_MEMBER,
> added for symmetry)
> that can be used to check a struct, choosing the compiler to use.
The existing convention for similar modules is to have separate C and
CXX versions, but this does not generalize well.
> I'm not sure if this is the right way to fix this (i.e. if
> CHECK_C_STRUCT_HAS_MEMBER is required), or if it is a better idea to add
> a parameter to the existing macro.
One could add an optional extra parameter to specify the language
to be used for the check (C or CXX). However, we should do something
that could be re-used in the similar modules too. Would you mind
surveying all the check signatures we currently have and reporting
back on their need/use of per-language variants?
Thanks,
-Brad
More information about the cmake-developers
mailing list