[cmake-developers] CMake 2.8.12 transitive link regression?
Clinton Stimpson
clinton at elemtech.com
Mon Nov 4 10:31:14 EST 2013
On Monday, November 04, 2013 09:48:57 AM Brad King wrote:
> On 11/02/2013 07:29 AM, Brad King wrote:
> > Policy CMP0022's NEW behavior is supposed to be that the
> > link interface is exactly specified by INTERFACE_LINK_LIBRARIES.
> > Therefore in this case the plain tll signature should go
> > ahead and populate *both* INTERFACE_LINK_LIBRARIES *and*
> > LINK_LIBRARIES.
>
> After working through the details of this over the weekend
> the fix and a bunch of tests are now in master. It ended
> up taking several commits. The main one is:
>
> CMP0022: Plain target_link_libraries must populate link interface
> http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ef10b87c
>
> Two other important changes are:
>
> Do not export INTERFACE_LINK_LIBRARIES from non-linkable targets
> http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=23d21b78
>
> CMP0022: Warn about a given target at most once
> http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0a561a03
>
> I plan to include all this in 2.8.12.1. Please test ASAP.
>
> Thanks,
> -Brad
The problem I reported before indeed appears fixed.
But I see 2 others new problems.
1)
cmake_minimum_required(VERSION 2.8)
add_library(foo SHARED foo.cpp)
add_library(bar SHARED bar.cpp)
target_link_libraries(bar foo)
set_target_properties(bar PROPERTIES LINK_INTERFACE_LIBRARIES "")
add_executable(exe exe.cpp)
target_link_libraries(exe bar)
With 2.8.12.1, I now get a new warning that I did not get with 2.8.12. I'm
not sure why I'm getting that warning because the linking of exe looks
correct.
CMake Warning (dev) in CMakeLists.txt:
Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link
interface. Run "cmake --help-policy CMP0022" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
Target "bar" has an INTERFACE_LINK_LIBRARIES property which differs from
its LINK_INTERFACE_LIBRARIES properties.
INTERFACE_LINK_LIBRARIES:
foo
LINK_INTERFACE_LIBRARIES:
2)
cmake_minimum_required(VERSION 2.8.12)
add_library(foo SHARED foo.cpp)
add_library(bar SHARED bar.cpp)
target_link_libraries(bar foo)
set_target_properties(bar PROPERTIES LINK_INTERFACE_LIBRARIES "")
add_executable(exe exe.cpp)
target_link_libraries(exe bar)
I get no warning or error, but my LINK_INTERFACE_LIBRARIES property was not
respected and it linked both foo and bar into exe. This appears to be a
regression from 2.8.12 to 2.8.12.1.
--
Clinton Stimpson
Elemental Technologies, Inc
Computational Simulation Software, LLC
www.csimsoft.com
More information about the cmake-developers
mailing list