summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Convert: Inline uses of START_OUTPUTStephen Kelly2016-09-191-1/+3
|
* Convert: Move access to CurrentBinaryDirectory out of loopsStephen Kelly2016-09-191-4/+4
|
* Convert: Avoid START_OUTPUT enum when converting to relative pathsStephen Kelly2016-09-191-3/+4
|
* Convert: Remove last use of START enum valueStephen Kelly2016-09-191-1/+2
| | | | | | | | | | The enums just introduce unfamiliar names and don't provide value. The order of arguments is reversed, as that is the result of the cmOutputConverter::ConvertToRelativePath overload which accepts the RelativeRoot enum.
* Fix CTest test file generation for spaces in subdirectory namesStefano Soffia2016-09-131-0/+1
| | | | | | Encode the subdirectory names properly for CMake syntax. Closes: #16299
* cmLocalGenerator: Refactor test subdirectory generation loopStefano Soffia2016-09-131-8/+6
|
* Re-order link line to place RPATH entries before librariesDan Kegel2016-09-121-3/+3
| | | | | | | | | | | | Since we support adding arbitrary flags to the link line via `target_link_libraries` the project/user may add their own RPATH flags (typically for system library locations). Re-order the link line to place our generated RPATH entries before the libraries so that they also come before flag-specified entries. Otherwise our in-build-tree RPATH entries may not be preferred by the dynamic loader and we could collide with libraries in the system directories. Closes: #16293
* tidy: Fix readability-redundant-string-cstr issuesGregor Jasny2016-09-041-1/+1
|
* fix a load of include-what-you-use violationsDaniel Pfeifer2016-09-031-4/+10
|
* Convert: Replace Convert(FULL) with equivalentStephen Kelly2016-08-271-2/+5
| | | | | This is more explicit than funnelling everything through the Convert method.
* Convert: Replace trivial conversion with new methodStephen Kelly2016-08-271-4/+6
|
* Convert: Replace uses of Convert(NONE)Stephen Kelly2016-08-271-4/+4
| | | | These are equivalent to ConvertToOutputFormat.
* CMake: don't use else after returnDaniel Pfeifer2016-08-181-18/+11
|
* Make sure unnused parameters are /*named*/Daniel Pfeifer2016-08-161-4/+5
|
* Fix typos.Felix Geyer2016-07-101-1/+1
|
* use CM_NULLPTRDaniel Pfeifer2016-06-281-17/+17
|
* cmOutputConverter: remove unused 'local' argumentDaniel Pfeifer2016-06-201-3/+3
|
* cmLocalGenerator: Adopt target compile flag generationTobias Hunger2016-06-171-0/+27
| | | | | | Factor the flag generation out of cmCommonTargetGenerator::GetFlags into a new cmLocalGenerator::GetTargetCompileFlags method. This will allow it to be used without a target generator available.
* cmLocalGenerator: Add method to get Fortran-specific compiler flagsBrad King2016-06-171-0/+7
| | | | | | | | | | Add a cmLocalGenerator::GetTargetFortranFlags virtual method to get generator-specific generation of Fortran-specific flags. Implement it in cmLocalCommonGenerator by moving the implementation from cmCommonTargetGenerator::AddFortranFlags. This will allow it to be used without having a target generator available. Inspired-by: Tobias Hunger <tobias.hunger@qt.io>
* Merge topic 'avoid-cmMakefile-IssueMessage-after-configure'Brad King2016-06-131-1/+2
|\ | | | | | | | | | | | | | | ea5324cd cmMakefile: Port messages for compile features to cmake df8c3130 cmGlobalGenerator: Don't use cmMakefile::IssueMessage after configure 946d1e50 cmMakefile: Avoid IssueMessage after configure is finished 096c7754 cmLocalGenerator: Store Backtrace for the directory
| * cmLocalGenerator: Store Backtrace for the directoryStephen Kelly2016-06-121-1/+2
| | | | | | | | Don't rely on cmMakefile to provide that. Use it to issue messages.
* | cmLocalGenerator: Add GetTargetDefines to get all defines for a targetTobias Hunger2016-06-101-0/+14
| |
* | cmLocalGenerator: Constify AppendDefines and AddCompileDefinitionsBrad King2016-06-101-3/+4
|/
* cmLocalGenerator: Move GetFrameworkFlags implementation to private helperTobias Hunger2016-06-091-9/+19
|
* cmLocalGenerator: Adopt GetFrameworkFlags methodTobias Hunger2016-06-091-0/+48
| | | | Move it from cmCommonTargetGenerator.
* cmLocalGenerator: Pass configuration to GetTargetFlagsTobias Hunger2016-06-081-6/+4
| | | | | Move the configuration lookup to call sites. This will allow multi-configuration callers to use the method.
* cmLocalGenerator: Consolidate conditions in AddArchitectureFlagsBrad King2016-06-021-5/+1
| | | | Make room for possible future non-Apple architecture flags.
* Remove unnecessary local copies.Daniel Pfeifer2016-05-261-3/+2
| | | | | | | Use clang-tidy's performance-unnecessary-copy-initialization checker. After applying the fix-its (which turns the copies into const&), revise the changes and see whether the copies can be removed entirely by using the original instead.
* Merge topic 'improve-character-find-and-replace'Brad King2016-05-251-6/+6
|\ | | | | | | | | | | | | | | 5784747d Improve string find: prefer character overloads. 5cec953e Use std::replace for replacing chars in strings. 2a1a2033 cmExtraEclipseCDT4Generator: use std::replace. 34bc6e1f cmCTestScriptHandler: don't call find repeatedly.
| * Improve string find: prefer character overloads.Daniel Pfeifer2016-05-241-4/+4
| | | | | | | | | | Apply fix-its from clang-tidy's performance-faster-string-find checker. Ignore findings in kwsys.
| * Use std::replace for replacing chars in strings.Daniel Pfeifer2016-05-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | Find uses of `cmSystemTools::ReplaceString` where both `replace` and `with` are string literals with a size of one. Automate with: git grep -l ReplaceString | xargs sed -i "s|cmSystemTools::ReplaceString(\([^,]*\), \"\(.\)\", \"\(.\)\");|std::replace(\1.begin(), \1.end(), '\2', '\3');|g" git grep -l ReplaceString | xargs sed -i "s|cmSystemTools::ReplaceString(\([^,]*\), \"\(.\)\", \"\\\\\\\\\");|std::replace(\1.begin(), \1.end(), '\2', '\\\\\\\\');|g" git grep -l ReplaceString | xargs sed -i "s|cmSystemTools::ReplaceString(\([^,]*\), \"\\\\\\\\\", \"\(.\)\");|std::replace(\1.begin(), \1.end(), '\\\\\\\\', '\2');|g"
* | Use enums defined in cmOutputConverter using their fully qualified name.Daniel Pfeifer2016-05-251-1/+1
|/ | | | | | | | | Mostly automated: values=("RelativeRoot" "NONE" "FULL" "HOME" "START" "HOME_OUTPUT" "START_OUTPUT" "OutputFormat" "UNCHANGED" "MAKERULE" "SHELL" "WATCOMQUOTE" "RESPONSE" "FortranFormat" "FortranFormatNone" "FortranFormatFixed" "FortranFormatFree") for i in "${values[@]}"; do git grep -l cmLocalGenerator::$i | xargs sed -i "s|cmLocalGenerator::$i|cmOutputConverter::$i|g"; done
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-1304/+877
| | | | | | | | | | | | | 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.
* Remove `//------...` horizontal separator commentsBrad King2016-05-091-43/+0
| | | | | | | | | | | | | | | | | | | | | | | | Modern editors provide plenty of ways to visually separate functions. Drop the explicit comments that previously served this purpose. Use the following command to automate the change: $ git ls-files -z -- \ "*.c" "*.cc" "*.cpp" "*.cxx" "*.h" "*.hh" "*.hpp" "*.hxx" | egrep -z -v "^Source/cmCommandArgumentLexer\." | egrep -z -v "^Source/cmCommandArgumentParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmDependsJavaLexer\." | egrep -z -v "^Source/cmDependsJavaParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmExprLexer\." | egrep -z -v "^Source/cmExprParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmFortranLexer\." | egrep -z -v "^Source/cmFortranParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmListFileLexer\." | egrep -z -v "^Source/cm_sha2" | egrep -z -v "^Source/(kwsys|CursesDialog/form)/" | egrep -z -v "^Utilities/(KW|cm).*/" | xargs -0 sed -i '/^\(\/\/---*\|\/\*---*\*\/\)$/ {d;}' This avoids modifying third-party sources and generated sources.
* 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.