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.
A library or executable target that consists only of a reference to an
object library may have no sources to compile or custom commands to run.
The command in the target is the link (or archive) command. Add missing
order-only dependencies to link commands so that target ordering
dependencies are satisfied for it without depending on an intermediate
compilation rule.
Extend the ObjectLibrary test to cover this case.
Co-Author: Brad King <brad.king@kitware.com>
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.
Reference OBJECT libraries for inclusion in targets that have no other
sources to verify that the linker language propagates correctly from the
object libraries. Test with a STATIC library, a SHARED library, and an
EXECUTABLE target. Use the static and shared libraries each in
executables that end up using the object library symbols.
In VS 6, 7, and 7.1 add a dummy object file to convince the IDE to build
the targets without sources. In Xcode add a dummy source file to
convince it to build targets without sources.
Add "ObjectLibrary" test to build and use OBJECT libraries. Build
multiple object libraries in separate directories with different flags.
Use a custom command to generate a source file in one OBJECT library.
Reference the OBJECT libraries for inclusion in a STATIC library, a
SHARED library, and an EXECUTABLE target. Use the static and shared
libraries each in executables that end up using the object library
symbols. Verify that object library symbols are exported from the
shared library.