summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.h
Commit message (Collapse)AuthorAgeFilesLines
* Merge topic 'ninja-intel-ipo'Brad King2014-05-221-0/+2
|\ | | | | | | | | | | | | b6e2e0d1 Ninja: Fix Intel interprocedural optimization with static libraries 5d12b87b cmGeneratorTarget: Improve GetCreateRuleVariable API c2eeb08b cmTarget: Add GetFeatureAsBool method
| * cmTarget: Add GetFeatureAsBool methodBrad King2014-05-211-0/+2
| | | | | | | | Return the GetFeature method result converted to a boolean value.
* | Features: Add COMPILE_FEATURES generator expression.Stephen Kelly2014-05-211-0/+7
|/ | | | | | | | | | | | Allow setting build properties based on the features available for a target. The availability of features is determined at generate-time by evaluating the link implementation. Ensure that the <LANG>_STANDARD determined while evaluating COMPILE_FEATURES in the link implementation is not lower than that provided by the INTERFACE of the link implementation. This is similar to handling of transitive properties such as POSITION_INDEPENDENT_CODE.
* cmTarget: Evaluate CMP0026 and CMP0051 in calling contextBrad King2014-05-091-1/+2
| | | | | | | | | | | These policies should be checked at the call site that tries to access the LOCATION or SOURCES property, not the directory scope containing the target. Thread the caller context through cmTarget::GetProperty to use for checking the policy setting and emitting a diagnostic with proper backtrace. Extend the RunCMake.CMP0026 and RunCMake.CMP0051 tests with cross-directory cases.
* cmTarget: Drop unused GetProperty signatureBrad King2014-05-091-2/+0
| | | | | No callers use the second "scope" argument. Drop this signature and hard-code the default parameter value internally.
* Merge topic 'target_compile_features'Brad King2014-04-151-0/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 9eaf3755 Export: Populate INTERFACE_COMPILE_FEATURES property. 8ed59fc2 Add target_compile_features command. 4e6ca504 cmTargetPropCommandBase: Change the interface to return bool. 5412dede cmTarget: Transitively evaluate compiler features. baff4434 cmTarget: Allow populating COMPILE_FEATURES using generator expressions. f97bf437 Features: Add cxx_auto_type. 03355d6b cmTarget: Add COMPILE_FEATURES target property. faeddf64 project: Add infrastructure for recording CXX compiler features 913394af cmTarget: Add CXX_STANDARD and CXX_EXTENSION target properties. 8238a6cd Add some COMPILE_OPTIONS for specifying C++ dialect. 892243fc Tests: Require CMake 3.0 for the SystemInformation test. 59b5fdd3 Don't load Clang-CXX from AppleClang-CXX.
| * cmTarget: Transitively evaluate compiler features.Stephen Kelly2014-04-071-1/+3
| | | | | | | | | | | | | | | | | | | | | | Extend the interface of the target_compile_features command with PUBLIC and INTERFACE keywords. Populate the INTERFACE_COMPILER_FEATURES target property if they are set. Consume the INTERFACE_COMPILER_FEATURES target property from linked dependent targets to determine the final required compiler features and the compile flag, if needed. Use the same pattern of origin-debugging which is used for other build properties.
| * cmTarget: Allow populating COMPILE_FEATURES using generator expressions.Stephen Kelly2014-04-071-0/+1
| | | | | | | | | | | | Delay validation of the content as a feature if it contains a generator expression. It will be checked again at generate-time after evaluation.
* | cmTarget: Fix listing of source files at configure-time.Stephen Kelly2014-04-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit e5da9e51 (cmTarget: Allow any generator expression in SOURCES property., 2014-03-18), source files are computed by true evaluation of generator expressions, including TARGET_OBJECTS. This evaluation requires the presence of cmGeneratorTarget objects since commit bf98cc25 (Genex: Evaluate TARGET_OBJECTS as a normal expression., 2014-02-26). Ensure that we don't attempt to evaluate the TARGET_OBJECTS generator expression at configure-time, as can happen if CMP0024 or CMP0026 are OLD. Use old-style parsing of the source item to extract object target names in that case. Avoid calling GetProperty("SOURCES") to bypass warnings from CMP0051. Refactor existing logic in GetLanguages which is similar in intent to the new GetSourceFiles code.
* | Merge topic 'install-prefix-in-interface'Brad King2014-04-101-1/+2
|\ \ | | | | | | | | | | | | | | | 783bce29 Export: Disallow exported interface includes in src/build tree (#14592). c869984e RunCMake: Allow specifying the source dir and file to test.
| * | Export: Disallow exported interface includes in src/build tree (#14592).Stephen Kelly2014-04-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow directories in the source tree or build tree only if the install tree is a subdirectory of the source tree or build tree, as appropriate. Re-use the test files in the RunCMake.include_directories test to run in multiple scenarios. Bump the required CMake version in the test to 3.0 to ensure that the new policy warnings are emitted correctly.
* | | cmTarget: Add all sources traced from custom commands at once.Stephen Kelly2014-04-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The AddSource method accepts one file and tries to avoiding adding it to the sources-list of the target if it already exists. This involves creating many cmSourceFileLocation objects for matching on existing files, which is an expensive operation. Avoid the searching algorithm by appending the new sources as one group. Generate-time processing of source files will ensure uniqueness. Add a new AddTracedSources for this purpose. The existing AddSources method must process the input for policy CMP0049, but as these source filenames come from cmSourceFile::GetFullPath(), we can forego that extra processing.
* | | cmTarget: Short-circuit language computation if context independent.Stephen Kelly2014-04-091-0/+2
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Computing the language involves computing the source files, which is an expensive operation. It requires calling cmMakefile::GetOrCreateSource many times, which involves creating and matching on many cmSourceFileLocation objects. Source files of a target may depend on the head-target and the config as of commit e6971df6 (cmTarget: Make the source files depend on the config., 2014-02-13). The results are cached for each context as of commit c5b26f3b (cmTarget: Cache the cmSourceFiles in GetSourceFiles., 2014-04-05). Each target in the build graph causes language computation of all of its dependents with itself as the head-target. This means that for 'core' libraries on which everything depends, the source files are computed once for every transitive target-level-dependee and the result is not cached because the head-target is different. This was observed in the VTK buildsystem. Short circuit the computation for targets which have a source-list that is independent of the head-target. If the source-list has already been computed and the generator expression evaluation reports that it was context-independent, return the only source-list already cached for the target. Reset the short-circuit logic when sources are added and when the link libraries are re-computed.
* | cmTarget: Make GetSourceFiles string overload private.Stephen Kelly2014-04-061-3/+3
| | | | | | | | | | Consumers should use the cmSourceFile overload, which is now always the case.
* | cmTarget: Extract a ProcessSourceItemCMP0049 method.Stephen Kelly2014-04-061-0/+2
| | | | | | | | | | | | | | | | | | | | Avoid calling AddSource for each src filename. That involves checking each entry for uniqueness and creating a separate generator expression for each one. Instead, add a single entry for the list of sources. The source files are passed through a uniqueness filter at generate-time, so duplicates don't matter so much.
* | Remove extra semicolons from C++ code.Stephen Kelly2014-04-031-2/+2
|/ | | | | Clang based tools running over the code complain about these, but clang has a fixit for removing them.
* cmTarget: Make the SOURCES origin tracable.Stephen Kelly2014-04-021-0/+1
|
* cmTarget: Allow transitive evaluation of SOURCES property.Stephen Kelly2014-04-021-4/+8
| | | | | | | Extend the cmGeneratorExpressionDAGChecker with an interface returning the name of the top target. Use that to determine when there is a DAG violation, as required by the RunCMake.Languages tests.
* cmTarget: Make the source files depend on the config.Stephen Kelly2014-04-021-4/+9
| | | | | | | | | | | | | | | | | Disallow the use of config-specific source files with the Visual Studio and Xcode generators. They don't have any way to represent the condition currently. Use the same common-config API in cmQtAutoGenerators. While it accepts config-specific files, it doesn't have to support multiple configurations yet. Loop over the configs in cmTargetTraceDependencies and cmGlobalGenerator::WriteSummary and consume all source files. Loop over the configs in cmComputeTargetDepends and compute the object library dependencies for each config.
* cmTarget: Compute languages from object libraries on demand.Stephen Kelly2014-04-021-5/+0
|
* cmTarget: Store strings instead of cmSourceFile* to represent SOURCES.Stephen Kelly2014-03-311-1/+0
| | | | | | | This will allow the strings to contain generator expressions. At this point, generator expressions are still not part of the SOURCES property when it is read.
* cmTarget: Remove AddSourceFile methodStephen Kelly2014-03-311-1/+0
| | | | It is no longer used.
* cmTarget: Add a method to obtain list of filenames for sources.Stephen Kelly2014-03-311-0/+1
|
* cmTarget: Rename AddSource method for backward compatibility.Stephen Kelly2014-03-311-0/+1
| | | | Add a new AddSource method for future use.
* Merge topic 'fix-policy-scopes'Brad King2014-03-101-1/+4
|\ | | | | | | | | | | 50fd0a33 Tests: Simplify and document policy scopes in RunCMake.CMP* tests b1bbee3e Record more policies on targets when created
| * Record more policies on targets when createdBrad King2014-03-061-1/+4
| | | | | | | | | | Policies CMP0027, CMP0038, and CMP0046 have per-target meaning so record the policy settings on targets as they are created.
* | stringapi: Miscellaneous char* parametersBen Boeckel2014-03-081-1/+1
| |
* | stringapi: Use strings for feature argumentsBen Boeckel2014-03-081-1/+1
| |
* | stringapi: Pass configuration names as stringsBen Boeckel2014-03-081-67/+80
| |
* | cmTarget: Refactor GetLocation APIBrad King2014-03-081-5/+6
| | | | | | | | | | | | | | | | | | When given a non-NULL configuration the GetLocation returned the location for the given configuration. When given a NULL configuration the GetLocation method returned a location with the build-system placeholder for the configuration name. Split the latter use case out into a separate GetLocationForBuild method and update call sites accordingly.
* | strings: Remove cmStdString referencesBen Boeckel2014-03-081-12/+12
| | | | | | | | | | | | | | | | | | | | | | Casts from std::string -> cmStdString were high on the list of things taking up time. Avoid such implicit casts across function calls by just using std::string everywhere. The comment that the symbol name is too long is no longer relevant since modern debuggers alias the templates anyways and the size is a non-issue since the underlying methods are generated since it's inherited.
* | stringapi: Use strings in target nameBen Boeckel2014-03-081-9/+9
| |
* | stringapi: Use strings for the languagesBen Boeckel2014-03-081-1/+1
| |
* | stringapi: Use strings for source namesBen Boeckel2014-03-081-1/+1
| |
* | stringapi: Use strings for property namesBen Boeckel2014-03-081-8/+11
| | | | | | | | Property names are always generated by CMake and should never be NULL.
* | Merge topic 'msvc-compiler-pdb-files'Brad King2014-02-261-3/+20
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | fba51b09 MSVC: Add properties to configure compiler PDB files (#14762) 3737860a cmTarget: Add per-config compilation info 718a9532 cmTarget: Refactor ComputePDBOutputDir interface aae5184c Help: Refactor PDB_NAME and PDB_OUTPUT_DIRECTORY docs b4aac0ca Makefile: Fix per-config linker PDB output directory
| * | MSVC: Add properties to configure compiler PDB files (#14762)Brad King2014-02-261-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit v2.8.12~437^2~2 (VS: Separate compiler and linker PDB files 2013-04-05) we no longer set /Fd with the PDB_NAME or PDB_OUTPUT_DIRECTORY properties. Those properties now exclusively handle linker PDB files. Since STATIC libraries do not link their compiler PDB file becomes more important. Add new target properties "COMPILE_PDB_NAME[_<CONFIG>]" and "COMPILE_PDB_OUTPUT_DIRECTORY[_<CONFIG>]" to specify the compiler PDB file location and pass the value to the MSVC /Fd option.
| * | cmTarget: Add per-config compilation infoBrad King2014-02-241-0/+4
| | | | | | | | | | | | | | | | | | | | | Add a cmTarget::CompileInfo struct to hold per-configuration information about the compilation settings in a target. This is different than cmTarget::OutputInfo because it applies to any targets that can compile sources even if they do not link or archive.
| * | cmTarget: Refactor ComputePDBOutputDir interfaceBrad King2014-02-241-1/+2
| | | | | | | | | | | | | | | | | | Add a runtime parameter to specify the property name prefix. Update the call site to pass "PDB" to preserve the existing name for that call path.
| * | Makefile: Fix per-config linker PDB output directoryBrad King2014-02-241-2/+2
| |/ | | | | | | | | | | Also, now that all call sites of cmTarget::GetPDBName and cmTarget::GetPDBDirectory pass the configuration, make the argument non-optional.
* | cmTarget: Add GetTransitiveTargetClosure method.Stephen Kelly2014-02-241-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace calls to GetLinkInformation with calls to a method to get only the target closure, not the link languages etc. The replaced calls are used while evaluating generator expressions only. This makes transitive generator expression evaluation independent from the languages of a target. In a follow-up topic, it will be possible to make the languages depend on generator expression evaluation, via evaluation of the SOURCES and INTERFACE_SOURCES target properties. Because the order of entries is not the same as the final link line, the order of debug output is different in the RunCMake.CompatibleInterface test, because the BOOL_PROP7 target property is evaluated first. Adjust the test to account for that new order.
* | cmTarget: Avoid computing languages when computing transitive targets.Stephen Kelly2014-02-241-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the OLD CMP0022 behavior, we need to treat the implementation as the interface when computing the interface libraries. Make it possible to do that without computing the link languages by adding a new GetLinkImplementationLibraries method. Extend the existing GetLinkImplementation method to populate the languages if the libraries have already been computed and cached. Change GetTransitivePropertyTargets to invoke GetLinkInterfaceLibraries instead of GetLinkInterface. This is key, as it is a method called by cmGeneratorExpressionEvaluator. Change the cmGeneratorExpressionEvaluator to invoke GetLinkImplementationLibraries instead of GetLinkImplementation.
* | cmTarget: Move ComputeLinkInterface to the internal class.Stephen Kelly2014-02-241-4/+0
| | | | | | | | | | In a follow-up, this will use the OptionalLinkInterface in its API. That class is in the cmTargetInternals class.
* | cmTarget: Extract a ComputeLinkInterfaceLibraries method.Stephen Kelly2014-02-241-2/+8
| | | | | | | | | | | | When evaluating the SOURCES property, we will need to be able to access the link libraries without accessing the link languages, as the languages depend on the SOURCES.
* | cmTarget: Extract a ComputeLinkImplementationLanguages method.Stephen Kelly2014-02-241-0/+1
| |
* | cmTarget: Change GetTransitivePropertyLinkLibraries to output targets.Stephen Kelly2014-02-241-2/+2
| | | | | | | | | | | | | | The callers already skip non-targets, so unify the target search. Change supporting functions to accept a container of targets instead of strings where possible.
* | cmTarget: Find source files on request.Stephen Kelly2014-02-241-5/+0
| | | | | | | | | | | | In a follow-up, the list of sources will become dependent on the config, so check for existence in cmTarget::GetSourceFiles instead of up-front with cmGlobalGenerator::CheckTargets().
* | cmTarget: Move SourceFileFlags to cmGeneratorTarget.Stephen Kelly2014-02-241-29/+0
|/
* cmTarget: Clean up the InsertCompileDefinition implementation.Stephen Kelly2014-02-021-2/+1
| | | | | | | It accepts a before parameter but is never called with before=true. compile definitions are sorted by std::set, so it wouldn't make sense to allow user sorting.
* AddDependencies: new policy requires dependencies to existNils Gladitz2014-01-121-1/+3
| | | | | Added new policy CMP0046 which requires dependencies added by add_dependencies() to actually exist.