summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.h
Commit message (Collapse)AuthorAgeFilesLines
* Merge topic 'fix-target_link_libraries-wrong-dir'Brad King2015-06-261-1/+2
|\ | | | | | | | | 30c2e1dd cmTarget: Fix diagnostic of target_link_libraries in wrong directory (#15626)
| * cmTarget: Fix diagnostic of target_link_libraries in wrong directory (#15626)Brad King2015-06-251-1/+2
| | | | | | | | | | | | | | | | | | | | Since commit v3.3.0-rc1~62^2~5 (cmTarget: Store only cmListFileContext for CMP0023 handling, 2015-05-18) a call to target_link_libraries on a target that was defined in another (non-ancestor) directory crashes because no execution context is left active. Fix this by getting the execution context from the actual cmMakefile where the current target_link_libraries call takes place. Test this by verifying that such calls correctly produce an error diagnostic instead of crashing.
* | Merge topic 'data-layout'Brad King2015-06-081-37/+24
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 8174e5cd cmCustomCommand: Remove special member functions. 34e1d6db cmCustomCommand: Re-arrange data layout. 54cb76f2 cmComputeLinkDepends: Re-arrange data layout. b661d6c6 cmQtAutoGenerators: Re-arrange data layout. 40844a14 cmProcessTools: Re-arrange data layout. b1ff32af cmOrderDirectories: Re-arrange data layout. dd0417c7 cmInstallTargetGenerator: Re-arrange data layout. 125c4866 cmInstallFilesGenerator: Re-arrange data layout. 92b8b1fc cmGraphVizWriter: Re-arrange data layout. 7f3e1623 cmGlobalGenerator: Re-arrange data layout. d9df7fa7 cmComputeComponentGraph: Re-arrange data layout. db24e41b cmCommandArgumentParserHelper: Re-arrange data. 4cd13e80 cmComputeLinkInformation: Re-arrange data layout. 3e087a40 cmLocalUnixMakefileGenerator: Re-arrange data layout. e0421701 cmMakefile: Re-arrange data layout. c26696eb cmSourceFile: Re-arrange data. ...
| * | cmTarget: Re-arrange data layout.Stephen Kelly2015-06-071-29/+23
| | | | | | | | | | | | Size with GNU libstdc++-5.1 goes from 840 bytes to 808 bytes.
| * | cmTarget: Replace PolicyStatus members with PolicyMap.Stephen Kelly2015-06-071-9/+2
| | | | | | | | | | | | sizeof(cmTarget) goes from 856 to 840 with GNU libstdc++ 5.1.
* | | cmGeneratorTarget: Move Feature API from cmTarget.Stephen Kelly2015-06-061-5/+0
|/ /
* | cmMakefile: Make cmListFileBacktrace default constructible.Stephen Kelly2015-06-021-1/+1
|/
* Honor visibility properties for all target types (#15556)Brad King2015-05-261-1/+2
| | | | | | | | | | | | | | | | The <LANG>_VISIBILITY_PRESET and VISIBILITY_INLINES_HIDDEN were first merged in commit v2.8.12~322 (Merge topic 'VISIBILITY_PRESET-property', 2013-06-05) but worked only for shared libraries and executables with exports. Prior to commit v3.0.0-rc1~581^2 (GenerateExportHeader: Deprecate add_compiler_export_flags function., 2013-09-02) the add_compiler_export_flags function was used to add visibility flags to all targets. The visibility flags are useful for sources in all target types because they may be later linked into shared libraries or executables with exports. Introduce policy CMP0063 to enable them for all target types while preserving compatibility with existing projects that do not expect this.
* Merge topic 'use-std-unordered_map'Brad King2015-05-191-2/+10
|\ | | | | | | | | | | | | d7923b82 Use std::unordered_map instead of hash_map where available. 820777af Tests: Don't rely on ordering of targets in maps. 921d74d8 AutoGen: Don't iterate over a container while populating it.
| * Use std::unordered_map instead of hash_map where available.Stephen Kelly2015-05-181-2/+10
| |
* | cmTarget: Store only cmListFileContext for CMP0023 handling.Stephen Kelly2015-05-181-1/+1
|/ | | | | Only the top level execution context is shown, as appropriate, so store only that.
* Move property definition to cmState.Stephen Kelly2015-04-131-3/+0
|
* Link libraries by full path even in implicit directoriesBrad King2015-04-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | When CMP0003 was first introduced we wanted to link all libraries by full path. However, some projects had problems on platforms where find_library would find /usr/lib/libfoo.so when the project really wanted to link to /usr/lib/<arch>/libfoo.so and had been working by accident because pre-CMP0003 behavior used -lfoo to link. We first tried to address that in commit v2.6.0~440 (Teach find_library to avoid returning library paths in system directories, 2008-01-23) by returning just "foo" for libraries in implicit link directories. This caused problems for projects expecting find_library to always return a full path. We ended up using the solution in commit v2.6.0~366 (... switch library paths found in implicit link directories to use -l, 2008-01-31). However, the special case for libraries in implicit link directories has also proven problematic and confusing. Introduce policy CMP0060 to switch to linking all libraries by full path even if they are in implicit link directories. Explain in the policy documentation the factors that led to the original approach and now to this approach.
* OS X: Add handling for XCTest bundlesGregor Jasny2015-03-231-0/+3
| | | | | | | | | | An XCTest bundle is a CFBundle with a special product-type and bundle extension. For more information about XCTest visit the Mac Developer library at: http://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/testing_with_xcode/ Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
* Genex: Allow COMPILE_LANGUAGE when processing include directories.Stephen Kelly2015-03-091-1/+2
| | | | Issue an error if this is encountered by an IDE generator.
* Genex: Allow COMPILE_LANGUAGE when processing compile definitions.Stephen Kelly2015-03-091-1/+2
| | | | Issue an error if this is encountered by an IDE generator.
* Genex: Enable use of COMPILE_LANGUAGE for compile options.Stephen Kelly2015-03-091-1/+2
| | | | | | Follow-ups will allow the use of the generator expression for compile definitions and include directories for non-IDE generators.
* Port all cmOStringStream to std::ostringstream.Stephen Kelly2015-01-111-1/+1
| | | | All compilers hosting CMake support the std class.
* cmTarget: Track internally whether platform is AndroidBrad King2014-09-291-0/+1
| | | | Add an IsAndroid member to save whether CMAKE_SYSTEM_NAME is "Android".
* cmTarget: Avoid re-computing head-independent link interfacesBrad King2014-07-211-1/+2
|
* cmTarget: Move ComputeLinkImplementation* to internalsBrad King2014-07-211-5/+0
| | | | | There are no external callers, and this will allow the methods to see the full OptionalLinkImplementation internal structure.
* Merge topic 'dev/target-fastpaths'Brad King2014-07-181-0/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | a9c9b66c cmTarget: use a hash_map for cmTargets typedef bcb6dbc1 cmTarget: help the optimizer a bit 679f3dee cmTarget: use hash_set for sets of strings 23d6520d cmTarget: Allow caching of empty genex expansions cd54f1db cmTarget: Only copy GenEx expansions when necessary b75fc0e1 cmTarget: Don't set properties on custom targets 66076915 cmTarget: Use static strings for special property names cebefa71 cmTarget: Sort special property checks 97ce676e cmTarget: Fast path for regular properties 4cfa918a cmTarget: Factor out common code 85242b7d cmTarget: Use else/if trees rather than an if tree
| * cmTarget: use a hash_map for cmTargets typedefBen Boeckel2014-07-171-0/+7
| |
* | cmTarget: Cache compatible interface property setsBrad King2014-07-161-0/+10
| | | | | | | | | | | | | | Replace isLinkDependentProperty with a CompatibleInterfaces structure that records all the compatible interface properties in a set for each type. This avoids repeatedly traversing the link implementation closure and asking every target for its compatible interface properties.
* | cmTarget: Drop GetTransitivePropertyTargets methodBrad King2014-07-161-3/+0
| | | | | | | | Inline the implementation at the only remaining call site.
* | cmTarget: Make GetLink*Libraries methods safer to useBrad King2014-07-161-16/+22
|/ | | | | | | | Split the library lists out of LinkImplementation and LinkInterface into LinkImplementationLibraries and LinkInterfaceLibraries parent classes, respectively. Return these from GetLinkImplementationLibraries and GetLinkInterfaceLibraries, respectively, so that callers cannot access parts of the structures that have not been populated.
* Merge topic 'refactor-link-internals'Brad King2014-07-161-14/+4
|\ | | | | | | | | | | | | | | | | | | | | | | 1ca0c0e9 cmTarget: Refactor internal imported LinkInterface map 102eea60 cmTarget: Simplify internal ComputeLinkInterfaceLibraries method b0f57408 cmTarget: Move ComputeLinkInterfaceLibraries to internals c69e8a55 cmTarget: Refactor internal LinkInterface map 4db3990e cmTarget: Drop 'head' argument from processSources 4b8130b8 cmTarget: Drop 'head' argument from GetSourceFiles 4c763dd1 cmTarget: Drop 'head' argument from GetLanguages 190cabe7 cmTarget: Drop 'head' argument from ComputeLinkImplementationLanguages
| * cmTarget: Move ComputeLinkInterfaceLibraries to internalsBrad King2014-07-141-6/+0
| | | | | | | | | | There are no external callers, and this will allow the method to see the full OptionalLinkInterface internal structure.
| * cmTarget: Drop 'head' argument from GetSourceFilesBrad King2014-07-141-4/+2
| | | | | | | | No call sites need it to be anything but 'this'.
| * cmTarget: Drop 'head' argument from GetLanguagesBrad King2014-07-141-2/+1
| | | | | | | | No call sites need it to be anything but 'this'.
| * cmTarget: Drop 'head' argument from ComputeLinkImplementationLanguagesBrad King2014-07-141-2/+1
| | | | | | | | No call sites need it to be anything but 'this'.
* | cmTarget: Compile old-style link dependencies only for VS 6Brad King2014-07-141-3/+10
| | | | | | | | | | Compile all the "ForVS6" cmTarget members only on Windows. No other platforms support the VS 6 generator.
* | cmTarget: Rename old-style link dependencies code as "ForVS6"Brad King2014-07-141-19/+19
|/ | | | | | The old link dependency analysis is now needed only for the VS 6 generator code delimited by CM_USE_OLD_VS6 to support project-provided project templates. Rename the related cmTarget members to be "ForVS6".
* cmTarget: Add to LinkImplementation whether each library was a genexBrad King2014-07-071-4/+6
| | | | | | Implementation of CMP0027 OLD behavior needs to know whether each entry in LinkImplementation::Libraries came from a generator expression or not. Add a FromGenex member to cmLinkImplItem to record this.
* cmTarget: Add to LinkImplementation a backtrace for each libraryBrad King2014-07-071-4/+6
| | | | Allow clients to provide backtrace context on evaluation diagnostics.
* cmTarget: Refactor LinkImplementation to allow more informationBrad King2014-07-071-1/+11
| | | | | | | Create a cmLinkImplItem class derived from cmLinkItem so more information can be added to link implementation entries than link interface entries. Convert the LinkImplementation Libraries member to hold it. Update client sites accordingly.
* cmTarget: Teach GetLinkInterfaceLibraries to support $<LINK_ONLY>Brad King2014-06-251-3/+5
| | | | | | | Add a 'usage_requirements_only' parameter to GetLinkInterfaceLibraries and supporting internal APIs to pass through to ExpandLinkItems so it knows whether to use SetTransitivePropertiesOnly while evaluating generator expressions.
* cmTarget: Teach ExpandLinkItems how to support $<LINK_ONLY>Brad King2014-06-251-0/+1
| | | | | | | Add a 'usage_requirements_only' parameter to ExpandLinkItems so that it knows whether to use SetTransitivePropertiesOnly while evaluating generator expressions. Update existing call sites to pass 'false' since they are for linking and not usage requirements.
* cmTarget: Drop GetDirectLinkLibraries methodsBrad King2014-06-231-5/+0
| | | | | Inline the implementation in the last remaining caller and drop the methods.
* cmTarget: Lookup targets in LinkInterface and LinkImplementationBrad King2014-06-231-6/+8
| | | | | | | | | | | | | | | Instead of storing just the string names in these structures, lookup any target associated with each item and store its cmTarget pointer. Use the cmLinkItem class to hold the name and pointer together. Update client sites to use the pre-stored lookup result instead of looking up the target name again. Create a cmTarget::LookupLinkItems helper method to handle the lookup. Since lookups are now moving from cmComputeLinkDepends::AddLinkEntries to cmTarget::LookupLinkItems, move use of CheckCMP0004 to the latter. This drops use of CheckCMP0004 from entries added for _LIB_DEPENDS variables by cmComputeLinkDepends::AddVarLinkEntries, but I do not think that use was intentional originally anyway.
* cmTarget: Add GetUtilityItems to get target ordering dependenciesBrad King2014-06-231-0/+1
| | | | | | | Add a method like GetUtilities but that provides the target names already looked up and resolved to cmTarget pointers internally. Update call site in cmComputeTargetDepends::AddTargetDepend to use the already-found target instead of looking it up again.
* cmTarget: Add cmLinkItem to refer to a target by name and pointerBrad King2014-06-231-0/+12
| | | | | | | | Many items named in target_link_libraries calls are targets, but not all. Create a cmLinkItem type that acts like std::string so it can name an item but also has a pointer to a cmTarget that is the result of looking up the item name in the referencing target's scope. This will be useful to avoid duplicate lookup operations later.
* cmTarget: Add method to lookup other targets in a target's scopeBrad King2014-06-231-0/+2
| | | | | Move the main implementation of cmComputeLinkDepends::FindTargetToLink into cmTarget.
* cmTarget: Constify GetLinkImplementationClosure resultsBrad King2014-06-231-1/+1
| | | | Populate a vector of "cmTarget const*" instead of "cmTarget*".
* cmTarget: Constify GetTransitivePropertyTargets resultsBrad King2014-06-231-2/+2
| | | | Populate a vector of "cmTarget const*" instead of "cmTarget*".
* cmTarget: Drop 'head' target from GetImportInfoBrad King2014-06-231-4/+7
| | | | | | | Move generator expression evaluation for imported library lists out of GetImportInfo and into a new GetImportLinkInterface helper. This avoids duplicating the computation and storage of all imported target info just because some of it is parameterized on the 'head' target.
* cmTarget: Remove 'head' argument from GetLinkImplementationBrad King2014-06-231-7/+11
| | | | | | | | | | | | | Many of the 'head' arguments added by commit v2.8.11~289^2~1 (Make linking APIs aware of 'head' target, 2013-01-04) turned out not to be needed. The "link implementation" of a target never needs to be computed with anything but itself as the 'head' target (except for CMP0022 OLD behavior because then it is the link interface). Remove the unused 'head' target paths. Add "internal" versions of cmTarget::GetDirectLinkLibraries and GetLinkImplementationLibraries to support the CMP0022 OLD behavior without otherwise exposing the 'head' target option of these methods.
* cmTarget: Drop 'head' argument from GetLinkClosureBrad King2014-06-231-4/+2
| | | | It is only ever passed the 'this' target itself.
* cmTarget: Remove 'head' argument from GetLinkerLanguageBrad King2014-06-231-2/+1
| | | | | | It is only ever called with the 'this' target as the head. Co-Author: Stephen Kelly <steveire@gmail.com>
* cmTarget: Remove 'head' argument from GetLinkInformationBrad King2014-06-231-6/+4
| | | | | | No call sites use it anyway. Co-Author: Stephen Kelly <steveire@gmail.com>