summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Isolate formatted streaming blocks with clang-format off/onBrad King2016-05-061-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The clang-format tool can do a good job formatting most code, but well-organized streaming blocks are best left manually formatted. Find blocks of the form os << "...\n" "...\n" ; using the command $ git ls-files -z -- Source | egrep -v -z '^Source/kwsys/' | xargs -0 pcregrep -M --color=always -B 1 -A 1 -n \ '<<[^\n]*\n(^ *("[^\n]*("|<<|;)$|;)\n){2,}' Find blocks of the form os << "...\n" << "...\n" << "...\n"; using the command $ git ls-files -z -- Source | egrep -v -z '^Source/kwsys/' | xargs -0 pcregrep -M --color=always -B 1 -A 1 -n \ '<<[^\n]*\n(^ *<<[^\n]*(\\n"|<<|;)$\n){2,}' Surround such blocks with the pair /* clang-format off */ ... /* clang-format on */ in order to protect them from update by clang-format. Use the C-style `/*...*/` comments instead of C++-style `//...` comments in order to prevent them from ever being swallowed by re-formatting of surrounding comments.
* GHS: Shorten long object paths with duplicate source namesGeoff Viola2016-05-061-1/+0
| | | | | Detect when the resulting object path is too long and compute an alternative name using a hash.
* Format include directive blocks and ordering with clang-formatBrad King2016-04-291-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sort include directives within each block (separated by a blank line) in lexicographic order (except to prioritize `sys/types.h` first). First run `clang-format` with the config file: --- SortIncludes: false ... Commit the result temporarily. Then run `clang-format` again with: --- SortIncludes: true IncludeCategories: - Regex: 'sys/types.h' Priority: -1 ... Commit the result temporarily. Start a new branch and cherry-pick the second commit. Manually resolve conflicts to preserve indentation of re-ordered includes. This cleans up the include ordering without changing any other style. Use the following command to run `clang-format`: $ git ls-files -z -- \ '*.c' '*.cc' '*.cpp' '*.cxx' '*.h' '*.hh' '*.hpp' '*.hxx' | egrep -z -v '(Lexer|Parser|ParserHelper)\.' | egrep -z -v '^Source/cm_sha2' | egrep -z -v '^Source/(kwsys|CursesDialog/form)/' | egrep -z -v '^Utilities/(KW|cm).*/' | egrep -z -v '^Tests/Module/GenerateExportHeader' | egrep -z -v '^Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h' | xargs -0 clang-format -i This selects source files that do not come from a third-party. Inspired-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
* cmLocalGenerator: Simplify IssueMessage implementationBrad King2016-04-151-11/+1
| | | | | | | | | | | This method was added by commit v3.4.0-rc1~424^2~6 (cmLocalGenerator: Add IssueMessage method, 2015-06-13) in order to reduce callers' dependency on cmMakefile. Currently the implementation of cmLocalGenerator::IssueMessage is just a copy of the post-configure code path in cmMakefile::IssueMessage. De-duplicate the implementation by simply calling the cmMakefile copy for now. This will simplify upcoming refactoring of backtraces. The dependency on cmMakefile can be removed by future work once that is done.
* cmLocalGenerator: Use own IssueMessage methodBrad King2016-04-151-2/+2
|
* Merge topic 'fix-target-alias-in-subdir'Brad King2016-04-051-13/+2
|\ | | | | | | | | | | 0e44f489 Rename local target lookup methods to clarify purpose bc30f8b5 Fix lookup of an ALIAS target outside aliased target's directory (#16044)
| * Rename local target lookup methods to clarify purposeBrad King2016-04-011-2/+2
| | | | | | | | | | | | | | | | | | | | Rename methods: * `cmMakefile::Find{ => LocalNonAlias}Target` * `cmLocalGenerator::Find{ => LocalNonAlias}GeneratorTarget` These names clarify that they are for directory-local target names and do not consider alias targets.
| * Fix lookup of an ALIAS target outside aliased target's directory (#16044)Brad King2016-04-011-11/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactoring in commit v3.5.0-rc1~272^2~11 (cmTarget: Implement ALIAS in terms of name mapping, 2015-10-25) accidentally introduced logic that assumes ALIAS targets always reference targets in their own directory. Fix this and add a test case. The configure-step fix is that `cmMakefile::FindTarget` should not consider aliases. The purpose of this method is just to look up targets local to a directory. Since ALIAS and normal targets share a namespace we know a locally defined target will never collide with an ALIAS target anyway. The method has 3 call sites, and this change is safe for all of them: * `cmInstallCommand::HandleTargetsMode`: Rejects aliases before the call. * `cmFLTKWrapUICommand::FinalPass`: Should never have considered aliases. * `cmMakefile::FindTargetToUse`: Falls back to a global lookup anyway. The generate-step fix is that `cmLocalGenerator::FindGeneratorTarget` should not consider aliases. This method is the generate-step equivalent to the above. The method has 2 call sites, and this change is safe for both of them: * `cmInstallTargetGenerator::Compute`: Never uses an alias target name. * `cmLocalGenerator::FindGeneratorTargetToUse`: Falls back to global lookup. Reported-by: Matteo Settenvini <matteo@member.fsf.org>
* | Drop Visual Studio 6 generatorBrad King2016-03-091-1/+1
| | | | | | | | | | | | This generator has been deprecated since CMake 3.3. Remove it. Update documentation, modules, and tests to drop content specific to this generator.
* | Merge topic 'fix-target-lookup-performance-regression'Brad King2016-02-091-0/+2
|\ \ | |/ | | | | | | | | 9b7d5871 Improve internal generator target structure lookup 6cbf6a51 Fix internal target lookup performance regression
| * Improve internal generator target structure lookupBrad King2016-02-081-0/+2
| | | | | | | | | | | | | | | | In commit v3.5.0-rc1~272^2~6 (cmGlobalGenerator: Add FindGeneratorTarget API, 2015-10-25) a lookup was implemented via linear search. Replace it with an efficient data structure. Suggested-by: Stephen Kelly <steveire@gmail.com>
* | install: Add EXCLUDE_FROM_ALL option (#14921)Nick Lewis2016-02-041-3/+3
|/ | | | | | | | | | | | | | | | | | | Let us take an example of a project that has some tests in a component that need to be installed into a dedicated test package. The user expectation is that the result could be achieved by typing the following: make make tests make install DESTDIR=/testpkgs make install-tests However this results in test components in the default installation as well as the testpkg. Add an EXCLUDE_FROM_ALL option to the install() command to tell it that the installation rule should not be included unless its component is explicitly specified for installation.
* Port CMake from cmIML to KWIMLBrad King2015-12-181-2/+2
| | | | KWIML no longer uses a configured prefix.
* Merge branch 'reduce-cmState-accumulation' into ↵Brad King2015-11-251-4/+2
|\ | | | | | | reduce-cmState-accumulation-for-master
| * cmLocalGenerator: Use ScopePushPop RAII class to manage local variable scopesBrad King2015-11-251-4/+2
| |
* | cmGlobalGenerator: Remove map from cmTarget to cmGeneratorTargetStephen Kelly2015-10-271-0/+7
| | | | | | | | | | | | | | The configure-time and generate-time types should be completely independent. Add ownership of cmGeneratorTarget instances to the cmLocalGenerator.
* | cmLocalGenerator: Port Find method away from GetGeneratorTargetStephen Kelly2015-10-271-3/+13
| | | | | | | | Mirror the cmMakefile::FindTarget method.
* | cmLocalGenerator: Store imported targets in a separate container.Stephen Kelly2015-10-271-0/+5
| |
* | cmLocalGenerator: Port FindGeneratorTarget away from GetGeneratorTargetStephen Kelly2015-10-271-2/+38
| |
* | cmLocalGenerator: Port internals to cmGeneratorTargetStephen Kelly2015-10-271-5/+4
| |
* | cmLocalGenerator: Add IsRootMakefile APIStephen Kelly2015-10-271-0/+5
| |
* | cmLocalGenerator: Add GetPolicyStatus APIStephen Kelly2015-10-271-2/+8
| |
* | Use cmLocalGenerator at generate-time.Stephen Kelly2015-10-241-1/+1
| |
* | Port to GetGeneratorTargets.Stephen Kelly2015-10-241-13/+14
| |
* | cmInstallTargetGenerator: Get a cmGeneratorTarget directly.Stephen Kelly2015-10-241-0/+7
| | | | | | | | Extend the cmGeneratorTarget API to make this possible.
* | cmLocalGenerator: Store a vector of generator targets.Stephen Kelly2015-10-211-11/+11
| | | | | | | | Not a map from cmTarget to cmGeneratorTarget.
* | Merge topic 'use-generator-target'Brad King2015-10-211-6/+6
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | c099e00f Access policy status from cmGeneratorTarget at generate time. d74bca5a cmGeneratorTarget: Copy the policy map from the cmTarget. c6e86955 cmTarget: Remove unused NameResolvesToFramework. 18046bd5 cmCommonTargetGenerator: Use NameResolvesToFramework without cmTarget. 91411641 Move ComputeLinkType out of cmTarget. 6d94078e cmGeneratorTarget: Move IsDLLPlatform from cmTarget. 3ebc6285 cmGeneratorTarget: Move HaveWellDefinedOutputFiles from cmTarget. 311018e5 cmGeneratorTarget: Move GetExportMacro from cmTarget. 215cd21a cmGeneratorTarget: Provide direct access to the backtrace. 1df8bd3a cmGlobalGenerator: Port IsRootOnlyTarget to cmGeneratorTarget. 83703bda cmGeneratorTarget: Copy IsExecutableWithExports from cmTarget.
| * | Access policy status from cmGeneratorTarget at generate time.Stephen Kelly2015-10-201-2/+2
| | |
| * | cmGeneratorTarget: Provide direct access to the backtrace.Stephen Kelly2015-10-201-2/+2
| | |
| * | cmGeneratorTarget: Copy IsExecutableWithExports from cmTarget.Stephen Kelly2015-10-201-2/+2
| | |
* | | cmLocalGenerator: Simplify semantic of adding generator targets.Stephen Kelly2015-10-201-1/+0
| | | | | | | | | | | | Don't store on the global generator as a side effect. Update clients to adapt.
* | | cmLocalGenerator: Don't store imported generator targetsStephen Kelly2015-10-201-6/+1
|/ / | | | | | | | | No consumers need them. This makes GetGeneratorTargets more comparable to cmMakefile::GetTargets, which does not include imported targets.
* | cmLocalGenerator: Port PList handling to cmGeneratorTarget.Stephen Kelly2015-10-181-3/+3
| |
* | cmLocalGenerator: Port policy handling to cmGeneratorTarget.Stephen Kelly2015-10-171-1/+1
| |
* | cmLocalGenerator: Port some API to cmGeneratorTarget.Stephen Kelly2015-10-171-34/+34
| |
* | Use GetName from cmGeneratorTarget.Stephen Kelly2015-10-171-1/+1
| |
* | Use IsImported from cmGeneratorTarget.Stephen Kelly2015-10-161-1/+1
| |
* | Merge topic 'clean-up-cmTarget'Brad King2015-10-161-32/+32
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 55474e61 cmState: Move GetTargetTypeName from cmTarget. 38df5c36 Remove now-obsolete casts. 4ee2b267 cmGeneratorTarget: Use enum for GetType. eac15298 cmState: Move TargetType enum from cmTarget. 482b3811 cmTarget: Move link type enum out. 2ee1cb85 cmTarget: Move ImportInfoMap out of internal class. a48bcabd cmTarget: Move backtrace member out of internal class. 6694d993 cmTarget: Remove unneeded constructors. 983c00f8 Generators: Use GetType from the cmGeneratorTarget.
| * | cmState: Move GetTargetTypeName from cmTarget.Stephen Kelly2015-10-141-2/+2
| | |
| * | cmState: Move TargetType enum from cmTarget.Stephen Kelly2015-10-141-30/+30
| | | | | | | | | | | | | | | | | | | | | Mostly automated: values=( "EXECUTABLE" "STATIC_LIBRARY" "SHARED_LIBRARY" "MODULE_LIBRARY" "OBJECT_LIBRARY" "UTILITY" "GLOBAL_TARGET" "INTERFACE_LIBRARY" "UNKNOWN_LIBRARY" "TargetType") for i in "${values[@]}"; do git grep -l cmTarget::$i | xargs sed -i "s|cmTarget::$i|cmState::$i|g"; done
| * | Generators: Use GetType from the cmGeneratorTarget.Stephen Kelly2015-10-141-2/+2
| | |
* | | cmLocalGenerator: Port GetTargetDirectory to cmGeneratorTarget.Stephen Kelly2015-10-141-1/+1
|/ /
* | cmLocalGenerator: Store cmGeneratorTargets.Stephen Kelly2015-10-141-3/+21
| | | | | | | | Relieve cmMakefile of this responsibility.
* | Merge topic 'use-generator-target'Brad King2015-10-121-2/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1c1c2a12 cmGeneratorTarget: Port ExpandLinkItems away from cmTarget. c66084f5 cmGeneratorTarget: Port GetImportLinkInterface away from cmTarget. 83c29e39 cmGeneratorTarget: Port ComputeLinkImplementationLibraries away from cmTarget. 19882554 cmGeneratorTarget: Port handleSystemIncludesDep away from cmTarget. c1f687b1 cmGeneratorTarget: Port GetLinkImplementationLibrariesInternal. a6e1f05c cmGeneratorTarget: Port ComputeLinkInterface away from cmTarget. 654002fe cmGeneratorTarget: Port ComputeLinkInterfaceLibraries away from cmTarget. 922c8901 cmGeneratorTarget: Port GetLinkInterface away from cmTarget. eaa5b9cb cmGeneratorTarget: Port cmTargetCollectLinkLanguages away from cmTarget. f539da12 cmGeneratorTarget: Port GetLinkInterfaceLibraries away from cmTarget. 1c5d70f9 cmGeneratorTarget: Port processILibs away from cmTarget. 064c2488 cmComputeLinkDepends: Port some API to cmGeneratorTarget. 3e428fdc cmGeneratorTarget: Move IsImportedSharedLibWithoutSOName from cmTarget. 110fd2fb cmGeneratorTarget: Move GetOutputTargetType from cmTarget. e7391699 cmGeneratorTarget: Move HasMacOSXRpathInstallNameDir from cmTarget. c5718217 cmGeneratorTarget: Move HaveInstallTreeRPATH from cmTarget. ...
| * | cmGeneratorTarget: Move link implementation from cmTarget.Stephen Kelly2015-10-081-2/+2
| | |
* | | cmLocalGenerator: Add current source directory accessor.Stephen Kelly2015-10-101-0/+5
| | |
* | | cmLocalGenerator: Add current binary directory accessor.Stephen Kelly2015-10-101-0/+5
| | |
* | | cmLocalGenerator: Add Home directory accessors.Stephen Kelly2015-10-081-0/+10
| | | | | | | | | | | | Reduce reasons for cmLocalGenerator to have a cmMakefile.
* | | cmLocalGenerator: Add GetProjectName method.Stephen Kelly2015-10-081-0/+5
|/ /
* | cmLocalGenerator: Add cmake instance accessor.Stephen Kelly2015-10-081-0/+5
| |