Commit Graph

11 Commits

Author SHA1 Message Date
Raul Tambre
359c500a24 cmTarget: Raise error if imported target location is not set
Previously we would synthesize <TARGET_NAME>-NOTFOUND as the location. This
would then end up on the link line and cause build failures.
Policy CMP0110 is added to control this behaviour.

Fixes #19080, #19943.
2020-08-21 08:38:39 -04:00
Brad King
bafa9fe887 fileapi: Add INTERFACE libraries with SOURCES to codemodel-v2
INTERFACE libraries with SOURCES now appear in the generated
buildsystem, so include them in the codemodel output too.

We do not need to bump the `codemodel-v2` object kind minor
version because that was already done in post-3.18 development
by commit 7d6861f367 (fileapi: Extend codemodel targets with
language standard, 2020-06-18).

Fixes: #18608
2020-08-07 08:46:34 -04:00
Justin Goshi
2f383d852d fileapi: Support multiple backtraces for language standard 2020-07-06 11:40:39 -07:00
Justin Goshi
7d6861f367 fileapi: Extend codemodel targets with language standard 2020-06-26 08:52:29 -04:00
Justin Goshi
9f6d40ee23 fileapi: Extend codemodel targets with PRECOMPILE_HEADERS 2020-05-22 11:26:55 -04:00
Justin Goshi
b698764a31 Tests: Add a PCH example to RunCMake.FileAPI codemodel-v2 2020-05-22 11:23:33 -04:00
Brad King
b3812c0e54 Tests: Fix indentation in RunCMake.FileAPI cxx_exe.json 2020-05-22 10:07:30 -04:00
Brad King
a833aa1167 Fix dependencies on targets linked through object libraries
When an object library is used via `target_link_libraries`, any targets
listed in the object library's `INTERFACE_LINK_LIBRARIES` closure should
become direct dependencies of the consuming target.  However, these were
accidentally left out by `cmComputeTargetDepends::CollectTargetDepends`
because object libraries are encountered through external object sources
first and then added to the `emitted` set which blocks them from being
processed as link dependencies.

This was not noticed by the test case in commit bab24e782c
(target_link_libraries: Propagate dependencies of object libraries,
2018-12-10, v3.14.0-rc1~260^2) because the relevant dependency appears
transitively through the object library target itself.

Re-order the logic to process link dependencies first, and then external
object sources.  That way object libraries used via
`target_link_libraries` will be treated as such by dependency analysis.

This also adds missing backtrace information for object libraries used
via `target_link_libraries`.  The missing information was mentioned in a
FIXME comment in the RunCMake.FileAPI test added by commit ea0a060168
(fileapi: Add test for codemodel v2, 2018-11-09, v3.14.0-rc1~257^2~7).
That comment itself was dropped by commit a0de350e2f (FileAPI test:
Break gen_check_targets() into JSON files, 2020-02-07), but we can now
update the corresponding location in the `.json` files to have the
now-expected backtrace information.

Fixes: #20421
2020-03-04 13:07:41 -05:00
Kyle Edwards
75e71263e7 FileAPI test: Break gen_check_projects() into JSON files 2020-02-07 13:42:20 -05:00
Kyle Edwards
a0de350e2f FileAPI test: Break gen_check_targets() into JSON files 2020-02-07 13:37:15 -05:00
Kyle Edwards
de8ebc9dba FileAPI test: Break gen_check_directories() into JSON files 2020-02-07 11:17:23 -05:00