CMake/Tests/RunCMake/CMP0026
Stephen Kelly 23f3798c7b cmTarget: Compute link language of TARGET_OBJECTS with CMP0026 OLD (#15338)
Commit v3.1.0-rc1~297^2~5 (cmTarget: Drop 'head' argument from
GetSourceFiles, 2014-07-10) exposed a dormant bug in source file computation,
causing the test case to regress.  After that commit, the source file
computation and caching finds an existing container of source files.  Prior to
that patch, the GetSourceFiles method was called with either a null pointer
for the head cmTarget, or it was called with the this pointer.  The
processSources method is eventually called, which normalizes the difference
between the null pointer and the this pointer for the head target.  However,
the cache key depends on the actual pre-normalized pointer.  The change in
that commit caused the entry to be found in the cache where it was not before,
which resulted in incorrect behavior.

Prior to that commit, the test case also fails if the GetSourceFiles overload
taking a vector<cmSourceFile*> is changed to normalize the head target at
the beginning of the method:

  cmTarget const* head = head_ ? head_ : this;

Such a construct was correctly used in other locations where similar caching
was in place, before being removed in commit v3.1.0-rc1~310^2~25 (cmTarget:
Remove 'head' argument from GetLinkInformation, 2014-06-12), but is not
neccessary anymore.

Commit v3.1.0-rc1~674^2~2 (cmTarget: Cache the cmSourceFiles in
GetSourceFiles., 2014-04-05) introduced the caching, but fails the test case
for an unrelated reason.  That unrelated error was introduced in
commit v3.1.0-rc1~688^2~5 (cmTarget: Allow any generator expression in
SOURCES property., 2014-03-18) and fixed in
commit v3.1.0-rc1~561^2~1 (cmTarget: Fix listing of source files at
configure-time., 2014-04-13).

All commits which fail the test case in the testable way do so when such a
cached version of the source files is found and returned at generate
time.  In the test case, the cached content is populated at configure-time
through the use of the deprecated LOCATION property with CMP0026 OLD.  The
cached content is an empty container for the bar target in the test case,
because its source file 'foo.cpp.o' is not known until generate-time.  That
means that no source files are available to compute the link language and
the reported error is issued.

The actual problem is that the SourceFilesMap should be cleared after
configure time by cmTarget::ClearLinkMaps.  Clear it there now.
2015-01-13 09:36:20 +01:00
..
CMP0026-WARN-Dir cmTarget: Evaluate CMP0026 and CMP0051 in calling context 2014-05-09 11:24:15 -04:00
CMP0026-CONFIG-LOCATION-NEW-result.txt cmTarget: Restore <CONFIG>_LOCATION to CMP0026 OLD behavior (#14808) 2014-03-17 09:30:39 -04:00
CMP0026-CONFIG-LOCATION-NEW-stderr.txt Policies: omit warnings about unset policies when they are actually set to NEW 2014-03-31 09:45:10 -04:00
CMP0026-CONFIG-LOCATION-NEW.cmake cmTarget: Restore <CONFIG>_LOCATION to CMP0026 OLD behavior (#14808) 2014-03-17 09:30:39 -04:00
CMP0026-CONFIG-LOCATION-OLD-result.txt cmTarget: Restore <CONFIG>_LOCATION to CMP0026 OLD behavior (#14808) 2014-03-17 09:30:39 -04:00
CMP0026-CONFIG-LOCATION-OLD-stderr.txt cmTarget: Restore <CONFIG>_LOCATION to CMP0026 OLD behavior (#14808) 2014-03-17 09:30:39 -04:00
CMP0026-CONFIG-LOCATION-OLD.cmake cmTarget: Restore <CONFIG>_LOCATION to CMP0026 OLD behavior (#14808) 2014-03-17 09:30:39 -04:00
CMP0026-CONFIG-LOCATION-WARN-result.txt cmTarget: Restore <CONFIG>_LOCATION to CMP0026 OLD behavior (#14808) 2014-03-17 09:30:39 -04:00
CMP0026-CONFIG-LOCATION-WARN-stderr.txt cmTarget: Restore <CONFIG>_LOCATION to CMP0026 OLD behavior (#14808) 2014-03-17 09:30:39 -04:00
CMP0026-CONFIG-LOCATION-WARN.cmake cmTarget: Restore <CONFIG>_LOCATION to CMP0026 OLD behavior (#14808) 2014-03-17 09:30:39 -04:00
CMP0026-IMPORTED-result.txt cmTarget: Deprecate the LOCATION target property with a policy. 2013-10-11 21:17:27 +02:00
CMP0026-IMPORTED-stderr.txt cmTarget: Deprecate the LOCATION target property with a policy. 2013-10-11 21:17:27 +02:00
CMP0026-IMPORTED.cmake cmTarget: Deprecate the LOCATION target property with a policy. 2013-10-11 21:17:27 +02:00
CMP0026-LOCATION-CONFIG-NEW-result.txt cmTarget: Restore <CONFIG>_LOCATION to CMP0026 OLD behavior (#14808) 2014-03-17 09:30:39 -04:00
CMP0026-LOCATION-CONFIG-NEW-stderr.txt Policies: omit warnings about unset policies when they are actually set to NEW 2014-03-31 09:45:10 -04:00
CMP0026-LOCATION-CONFIG-NEW.cmake cmTarget: Restore <CONFIG>_LOCATION to CMP0026 OLD behavior (#14808) 2014-03-17 09:30:39 -04:00
CMP0026-LOCATION-CONFIG-OLD-result.txt cmTarget: Restore <CONFIG>_LOCATION to CMP0026 OLD behavior (#14808) 2014-03-17 09:30:39 -04:00
CMP0026-LOCATION-CONFIG-OLD-stderr.txt cmTarget: Restore <CONFIG>_LOCATION to CMP0026 OLD behavior (#14808) 2014-03-17 09:30:39 -04:00
CMP0026-LOCATION-CONFIG-OLD.cmake cmTarget: Restore <CONFIG>_LOCATION to CMP0026 OLD behavior (#14808) 2014-03-17 09:30:39 -04:00
CMP0026-LOCATION-CONFIG-WARN-result.txt cmTarget: Restore <CONFIG>_LOCATION to CMP0026 OLD behavior (#14808) 2014-03-17 09:30:39 -04:00
CMP0026-LOCATION-CONFIG-WARN-stderr.txt cmTarget: Restore <CONFIG>_LOCATION to CMP0026 OLD behavior (#14808) 2014-03-17 09:30:39 -04:00
CMP0026-LOCATION-CONFIG-WARN.cmake cmTarget: Restore <CONFIG>_LOCATION to CMP0026 OLD behavior (#14808) 2014-03-17 09:30:39 -04:00
CMP0026-NEW-result.txt cmTarget: Deprecate the LOCATION target property with a policy. 2013-10-11 21:17:27 +02:00
CMP0026-NEW-stderr.txt Policies: omit warnings about unset policies when they are actually set to NEW 2014-03-31 09:45:10 -04:00
CMP0026-NEW.cmake cmTarget: Deprecate the LOCATION target property with a policy. 2013-10-11 21:17:27 +02:00
CMP0026-WARN-result.txt cmTarget: Deprecate the LOCATION target property with a policy. 2013-10-11 21:17:27 +02:00
CMP0026-WARN-stderr.txt cmTarget: Evaluate CMP0026 and CMP0051 in calling context 2014-05-09 11:24:15 -04:00
CMP0026-WARN.cmake cmTarget: Evaluate CMP0026 and CMP0051 in calling context 2014-05-09 11:24:15 -04:00
CMakeLists.txt Cygwin: Avoid legacy warnings in RunCMake.CMP0026 test 2013-10-19 06:47:12 -04:00
LOCATION-and-TARGET_OBJECTS-result.txt cmTarget: Compute link language of TARGET_OBJECTS with CMP0026 OLD (#15338) 2015-01-13 09:36:20 +01:00
LOCATION-and-TARGET_OBJECTS-stderr.txt cmTarget: Compute link language of TARGET_OBJECTS with CMP0026 OLD (#15338) 2015-01-13 09:36:20 +01:00
LOCATION-and-TARGET_OBJECTS.cmake cmTarget: Compute link language of TARGET_OBJECTS with CMP0026 OLD (#15338) 2015-01-13 09:36:20 +01:00
ObjlibNotDefined-result.txt cmTarget: Don't assert on object libraries for configure-time location. 2014-05-06 21:07:40 +02:00
ObjlibNotDefined-stderr.txt cmTarget: Don't assert on object libraries for configure-time location. 2014-05-06 21:07:40 +02:00
ObjlibNotDefined.cmake cmTarget: Don't assert on object libraries for configure-time location. 2014-05-06 21:07:40 +02:00
RunCMakeTest.cmake cmTarget: Compute link language of TARGET_OBJECTS with CMP0026 OLD (#15338) 2015-01-13 09:36:20 +01:00
empty.cpp cmTarget: Deprecate the LOCATION target property with a policy. 2013-10-11 21:17:27 +02:00