Commit Graph

9 Commits

Author SHA1 Message Date
Brad King 2c470b775a add_library: Allow arbitrary non-linked sources in OBJECT libraries
Loosen this restriction on OBJECT libraries to allow source files of any
name to be generated by custom commands or listed for reference in IDE
projects so long as they would not affect linking of a normal library.
Update the rejection message to be more specific about the looser
restriction.

Extend the ObjectLibrary test to cover a ".cmake" file generated by a
custom command in an OBJECT library.
2014-07-09 09:43:42 -04:00
Stephen Kelly fdcefe3c42 cmGeneratorTarget: Compute consumed object libraries on demand.
Remove up-front object library computation from cmGlobalGenerator.

Adjust tests for message coming from the generator expression
evaluation.
2014-04-02 23:12:56 +02:00
Stephen Kelly e5da9e51d0 cmTarget: Allow any generator expression in SOURCES property.
Remove use of UseObjectLibraries from Makefile and Ninja generators. It
is not needed now because those generators use GetExternalObjects
which already contains the objects from object libraries.

The VS10 generator calls both the UseObjectLibraries and the GetExternalObjects
methods. Ensure that duplicates are not created by skipping objects
from object libraries in handling of GetExternalObjects.

Similarly, fix VS6, VS7 and Xcode object handling by skipping
external objects from OBJECT_LIBRARY usage as appropriate.

The error message in the BadSourceExpression1 test is now reported
by the generator expression evaluator, so it has different text.
2014-04-02 23:12:56 +02:00
Brad King 53ac9b8d86 Merge topic 'object-library-missing-source'
5a2fc3d Check for OBJECT_LIBRARY source files at start of generation
2013-11-02 10:54:15 -04:00
Brad King 5a2fc3d696 Check for OBJECT_LIBRARY source files at start of generation
Teach cmGlobalGenerator::CheckTargets to include OBJECT_LIBRARY targets
in the check for source file existence.

Extend the RunCMake.ObjectLibrary test to cover this case.
2013-11-01 14:46:58 -04:00
Stephen Kelly 310aef959b Make ExportLanguages a subtest of the ObjectLibrary test
It was a subtest of the RunCMake.ObjectLibrary test. However, we need
to test a build with ExternalProject after running CMake, which RunCMake tests
do not do.
2013-10-24 19:05:34 +02:00
Brad King d05a9bd1e6 Cygwin: Avoid legacy warnings in RunCMake.* tests
Set the minimum required version of CMake high enough to avoid the
warning for CMAKE_LEGACY_CYGWIN_WIN32.  The warning appears on stderr
and breaks the expected output matching.
2013-08-13 09:50:15 -04:00
Brad King db7ef82402 Test OBJECT library language propagation
Teach the RunCMake.ObjectLibrary test to verify that languages used in
an OBJECT library are propagated to targets that use it so that the
languages can be included in link analysis.
2012-03-16 10:12:30 -04:00
Brad King 5683101669 Test OBJECT library failure cases
Add "RunCMake.ObjectLibrary" test to verify that unsupported use cases
are rejected with errors:

* An OBJECT library may not reference another object library
* An OBJECT library may not be referenced in target_link_libraries
* An OBJECT library may not contain non-compiling sources
* An OBJECT library may not have pre/post build/link commands
* An OBJECT library may not be installed, exported, or imported

Also verify that invalid $<TARGET_OBJECTS:...> expressions are
diagnosed.
2012-03-16 10:12:30 -04:00