summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/ObjectLibrary
Commit message (Collapse)AuthorAgeFilesLines
* Tests: Add cases for usage requirements of linked object libsBrad King2018-03-015-0/+16
| | | | | | | Add tests to cover transitive usage requirements on installation and export of targets that link to object libraries. Issue: #14778
* objlib: Link object-files from `OBJECT` libraries.Deniz Bahadir2018-03-013-0/+27
| | | | | | | | | | Note: This finally links the object-files of the `OBJECT` library from the right-hand side of `target_link_libraries` to the target on the left-hand side. However, this will only happen with directly linked `OBJECT` libraries, not with `OBJECT` libraries "linked" through property `INTERFACE_LINK_LIBRARIES` of a target on the right-hand side! Fixes: #14778
* objlib: Allow `OBJECT` libraries to link to `OBJECT` libraries.Deniz Bahadir2018-03-0110-21/+40
| | | | | | | | | | Note: This still does not link the object-files of the `OBJECT` library from the right-hand side of `target_link_libraries` to the target on the left-hand side. (In this particular case of another `OBJECT` library on the left-hand side this would not make any sense anyway. The target on the left-hand side has no link-step.) Issue: #14778
* objlib: Allow other libraries to link to `OBJECT` libraries.Deniz Bahadir2018-03-0113-28/+67
| | | | | | | | Note: This only allows `OBJECT` libraries to be on the right-hand side of `target_link_libraries` but still does not link its object-files to the target on the left-hand side. Issue: #14778
* objlib: Allow `OBJECT` libraries to link to other libraries.Deniz Bahadir2018-03-018-9/+37
| | | | | | | | | | The proper way to use libraries is now through `target_link_libraries` for things such as usage requirements, compile definitions, include directories, etc. To facilitate this, allow `OBJECT` libraries to "link" to other libraries. Co-Author: Ben Boeckel <ben.boeckel@kitware.com> Issue: #14778
* install,export: Maybe transform OBJECT libraries to INTERFACE librariesBrad King2018-02-285-12/+3
| | | | | | | | | | | Teach the `install` and `export` commands to support installing and exporting `OBJECT` libraries without their object files. Transform them to `INTERFACE` libraries in such cases. For `install(TARGETS)`, activate this when no destination for the object files is specified. For `export`, activate this only under Xcode with multiple architectures when we have no well-defined object file locations to give to clients.
* target_link_libraries: Slightly fix some error-messages.Deniz Bahadir2017-11-291-2/+2
| | | | | Some error-messages are slightly adjusted to better tell what invocation would be correct instead. Tests are adjusted accordingly.
* Diagnose object library self-referenceBrad King2017-07-144-0/+9
| | | | | | | | | | | | | | | | | | | The code add_library(A OBJECT a.c) target_sources(A PRIVATE $<TARGET_OBJECTS:A>) used to crash CMake via infinite recursion while evaluating the generator expression. Then the change in commit v3.9.0-rc1~266^2~1 (cmGeneratorTarget: Replace source classifier implementation, 2017-04-07) avoided the infinite recursion because GetKindedSources now creates a map entry and initializes it once. If it is called again on the same target during that initialization, the partially computed results are returned. This is still wrong but does not crash. Detect and diagnose this case instead. Co-Author: Ben Boeckel <ben.boeckel@kitware.com> Fixes: #16578
* Allow OBJECT libraries to be installed, exported, and importedRobert Maynard2017-04-1813-11/+40
| | | | | | | | Teach install() and export() to handle the actual object files. Disallow this on Xcode with multiple architectures because it still cannot be cleanly supported there. Co-Author: Brad King <brad.king@kitware.com>
* Tests: Change RunCMake.ObjectLibrary dependencies case to CBrad King2017-02-2610-31/+27
|
* Tests: Fix RunCMake.ObjectLibrary dependency delayBrad King2017-02-261-5/+11
| | | | | | Sleep before the second copy to avoid the need for a touch. Sleep for longer on generators whose build tools have low resolution timestamps.
* Add test for object library dependenciesGregor Jasny2017-02-226-0/+52
| | | | Issue: #16615
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-1/+4
| | | | | | | | | | | | | Run the `Utilities/Scripts/clang-format.bash` script to update all our C++ code to a new style defined by `.clang-format`. Use `clang-format` version 3.8. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
* add_library: Allow arbitrary non-linked sources in OBJECT librariesBrad King2014-07-092-2/+4
| | | | | | | | | | | 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.
* cmGeneratorTarget: Compute consumed object libraries on demand.Stephen Kelly2014-04-022-0/+8
| | | | | | | Remove up-front object library computation from cmGlobalGenerator. Adjust tests for message coming from the generator expression evaluation.
* cmTarget: Allow any generator expression in SOURCES property.Stephen Kelly2014-04-021-1/+3
| | | | | | | | | | | | | | | | 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.
* Merge topic 'object-library-missing-source'Brad King2013-11-024-0/+12
|\ | | | | | | | | 5a2fc3d Check for OBJECT_LIBRARY source files at start of generation
| * Check for OBJECT_LIBRARY source files at start of generationBrad King2013-11-014-0/+12
| | | | | | | | | | | | | | Teach cmGlobalGenerator::CheckTargets to include OBJECT_LIBRARY targets in the check for source file existence. Extend the RunCMake.ObjectLibrary test to cover this case.
* | Make ExportLanguages a subtest of the ObjectLibrary testStephen Kelly2013-10-243-17/+0
|/ | | | | | 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.
* Cygwin: Avoid legacy warnings in RunCMake.* testsBrad King2013-08-131-1/+1
| | | | | | 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.
* Test OBJECT library language propagationBrad King2012-03-163-0/+17
| | | | | | 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.
* Test OBJECT library failure casesBrad King2012-03-1650-0/+146
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.