Test target link information invalidation
We test this by adding export(TARGETS) to the LinkLanguage test to export the executable before the library is linked to it. Since export(TARGETS) computes the link interface of the target (so that it can export it), this ensures that the information is recomputed after the link library is added.
This commit is contained in:
parent
0fb5b2c88c
commit
750eb105c2
|
@ -3,6 +3,11 @@ project(LinkLanguage C CXX)
|
||||||
|
|
||||||
add_library(foo STATIC foo.cxx)
|
add_library(foo STATIC foo.cxx)
|
||||||
add_executable(LinkLanguage LinkLanguage.c)
|
add_executable(LinkLanguage LinkLanguage.c)
|
||||||
|
|
||||||
|
# Export the target now to compute its link interface and implementation.
|
||||||
|
# This tests that the link info is recomputed after the library is linked.
|
||||||
|
export(TARGETS LinkLanguage FILE LinkLanguageTargets.cmake)
|
||||||
|
|
||||||
target_link_libraries(LinkLanguage foo)
|
target_link_libraries(LinkLanguage foo)
|
||||||
|
|
||||||
# CMake should now automatically choose CXX for linking, so we need
|
# CMake should now automatically choose CXX for linking, so we need
|
||||||
|
|
Loading…
Reference in New Issue