[PATCH] Adds a CMake package configuration file for libclang

Argyrios Kyrtzidis akyrtzi at gmail.com
Thu Mar 7 11:07:06 PST 2013


On Mar 7, 2013, at 9:59 AM, Brad King <brad.king at kitware.com> wrote:

> On 03/07/2013 12:32 PM, Jordan Rose wrote:
>> 
>> On Mar 7, 2013, at 6:42 , Brad King <brad.king at kitware.com> wrote:
>> 
>>> One thing the upstream devs should check is whether the version test
>>> in libclang-config-version.cmake.in looks correct.  The logic needs to
>>> match your interface compatibility and versioning policy.  Currently
>>> it says that versions will be forward and backward compatible across
>>> all minor versions of the same major version, and that a change in
>>> major version breaks compatibility.  This is a reasonable policy, but
>>> this code needs to match your actual policy.
>> 
>> AFAIK libclang is forward-compatible across minor versions, but not
>> backwards (i.e. because new features can be introduced with minor versions).

That is correct.

> 
> In that case the logic in the package version file needs to be
> something like:
> 
> set(PACKAGE_VERSION @LIBCLANG_LIBRARY_VERSION@)
> if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL @CLANG_VERSION_MAJOR@ AND
>    NOT "${PACKAGE_FIND_VERSION_MINOR}" GREATER @CLANG_VERSION_MINOR@)
>   set(PACKAGE_VERSION_COMPATIBLE 1)
>   if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL @CLANG_VERSION_MINOR@)
>     set(PACKAGE_VERSION_EXACT 1) # TODO: check patch level too?
>   endif()
> endif()
> 

The versions for the libclang API are 

CINDEX_VERSION_MAJOR
CINDEX_VERSION_MINOR

in $clang_source/include/clang-c/Index.h


> -Brad

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130307/e133b526/attachment.html>


More information about the cfe-commits mailing list