summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Convert: Avoid HOME_OUTPUT enum when converting to relative pathsStephen Kelly2016-09-191-1/+1
|
* Merge topic 'find-package-mode-fixes'Brad King2016-09-191-0/+1
|\ | | | | | | | | | | a098ca0d cmake: Fix --find-package mode link line output d9c600c5 cmGlobalGenerator: Fix use of uninitialized value in --find-package mode
| * cmGlobalGenerator: Fix use of uninitialized value in --find-package modeBrad King2016-09-161-0/+1
| |
* | cmGlobalGenerator: Refactor global target constructionBrad King2016-09-151-109/+95
| | | | | | | | | | | | Avoid using partially-constructed cmTarget instances. Collect the information about how to construct each target in a separate structure and then actually create each cmTarget with full construction.
* | cmGlobalGenerator: Split CreateDefaultGlobalTargets implementationBrad King2016-09-151-35/+51
|/ | | | | Divide this long method into multiple helpers each dedicated to one of the targets. This also avoids having to clear/re-use local structures.
* cmTarget: Construct with basic information up frontBrad King2016-09-141-2/+2
| | | | | Avoid having partially constructed cmTarget instances around, except for the special case of GLOBAL_TARGET construction.
* Avoid requiring default cmTarget constructor for map indexingBrad King2016-09-141-32/+52
| | | | | | The `std::map<>` index operator requires a default constructor on the value type. Avoid requiring a default constructor on `cmTarget` just for this purpose.
* fix a load of include-what-you-use violationsDaniel Pfeifer2016-09-031-6/+14
|
* Convert: Replace trivial conversion with new methodStephen Kelly2016-08-271-2/+2
|
* Make sure unnused parameters are /*named*/Daniel Pfeifer2016-08-161-9/+12
|
* use CM_NULLPTRDaniel Pfeifer2016-06-281-26/+28
|
* Remove redundant arguments from fstream constructorsDaniel Pfeifer2016-06-141-1/+1
| | | | Don't pass the default value of the openmode parameter explicitly.
* cmGlobalGenerator: Don't use cmMakefile::IssueMessage after configureStephen Kelly2016-06-121-3/+4
|
* Simplify boolean expressionsDaniel Pfeifer2016-06-021-2/+1
| | | | | | Use clang-tidy's readability-simplify-boolean-expr checker. After applying the fix-its, revise all changes *very* carefully. Be aware of false positives and invalid changes.
* Pass arguments that are not modified as const&.Daniel Pfeifer2016-05-261-1/+1
| | | | | | | Use clang-tidy's performance-unnecessary-value-param checker to find value parameter declarations of expensive to copy types that are not modified inside the function. Ignore findings in kwsys. After applying the fix-its, manually change `const T&` to `T const&`.
* Merge topic 'standard-include-directories'Brad King2016-05-251-0/+20
|\ | | | | | | | | | | | | c1340827 Add a variable to specify language-wide system include directories 44199097 cmMakefile: Optimize AddSystemIncludeDirectories for empty set a896043b GHS: Compute include directories consistently with other generators
| * Add a variable to specify language-wide system include directoriesBrad King2016-05-251-0/+20
| | | | | | | | | | | | | | Create a `CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES` variable to specify system include directories for for `<LANG>` compiler command lines. This plays a role for include directories as the existing `CMAKE_<LANG>_STANDARD_LIBRARIES` variable does for link libraries.
* | 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-1193/+825
| | | | | | | | | | | | | 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-44/+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/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Format include directive blocks and ordering with clang-formatBrad King2016-04-291-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Source: Stabilize include orderBrad King2016-04-291-0/+1
| | | | | Each source file has a logical first include file. Include it in an isolated block so that tools that sort includes do not move them.
* Avoid depending on CMAKE_ROOT cache entry internally (#16015)Brad King2016-03-161-1/+1
| | | | | | Use cmSystemTools::GetCMakeRoot() which always knows the location of our resources. Do not depend on CMAKE_ROOT because the user could unset it from the cache.
* Diagnose recursive project/enable_language without crashing (#15999)Brad King2016-03-071-0/+21
| | | | | | | Calling `project()` or `enable_language()` from a toolchain file will infinitely recurse since those commands load the toolchain file. Diagnose and reject this case with an error message instead of crashing when the stack eventually overflows.
* Merge topic 'cmake-gui-reset-generator'Brad King2016-02-161-0/+7
|\ | | | | | | | | da490e11 cmake-gui: Fix cmState initialization when changing generators (#15959)
| * cmake-gui: Fix cmState initialization when changing generators (#15959)Brad King2016-02-121-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | Refactoring in commit v3.3.0-rc1~29^2~1 (cmState: Host some state from the cmGlobalGenerator, 2015-05-24) moved storage of some generator traits over to cmState. However, it accidentally removed initialization of the values from the cmGlobalGenerator constructor. This is needed because generator subclasses update the settings in their constructors. Since a single cmState instance is shared across multiple build trees by cmake-gui, initializing the values in its constructor is not enough. Fix this by restoring the needed initializations to the cmGlobalGenerator constructor.
* | Improve internal generator target structure lookupBrad King2016-02-081-35/+14
| | | | | | | | | | | | | | | | 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>
* | Fix internal target lookup performance regressionBrad King2016-02-081-33/+13
|/ | | | | | | | | | | Refactoring in commit v3.5.0-rc1~272^2~13 (cmGlobalGenerator: Remove direct storage of targets, 2015-10-25) replaced an efficient data structure mapping from target name to cmTarget instance with a linear search. Lookups through cmGlobalGenerator::FindTarget are done a lot. Restore the efficient mapping structure with a name indicating its purpose. Reported-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
* Merge topic 'reduce-allocations'Brad King2016-01-211-6/+6
|\ | | | | | | | | | | | | | | | | 70788e92 Remove temporary allocations when calling cmHasLiteral{Suf,Pre}fix. bd2384f5 Optimize cmMakefile::ExpandVariablesInStringNew. ad9394f4 Remove temporary allocations in cmMacroHelper::InvokeInitialPass. f9599ed4 Remove temporary allocations by extending the lifetime of the retval. 275f2a85 Remove temporary allocations when calling cmGeneratorTarget::GetName.
| * Remove temporary allocations by extending the lifetime of the retval.Milian Wolff2016-01-201-6/+6
| | | | | | | | | | | | | | | | | | | | See also Herb Sutter's article on the "most important const": http://herbsutter.com/2008/01/01/gotw-88-a-candidate-for-the-most-important-const/ When running the CMake daemon on the KDevelop build dir, this removes some hundreds of thousands of temporary allocations. This hotspot was found with heaptrack.
* | cmSystemTools: Rename OUTPUT_NORMAL to OUTPUT_FORWARD to clarify its purposeBrad King2016-01-191-1/+1
|/ | | | | | The OUTPUT_NORMAL value is not really "normal" and has only one caller. Rename it to OUTPUT_FORWARD to clarify that we are explicitly forwarding the output.
* Alias: Fix access at generate-time (#15832)Stephen Kelly2015-11-081-0/+6
| | | | | | | | | | | | Commit c389f8bb (cmLocalGenerator: Port Find method away from GetGeneratorTarget, 2015-10-25) ported the implementation of FindGeneratorTargetToUse away from the FindTargetToUse method, but neglected to handle alias targets. The latter method has a parameter to determine whether to include alias targets in the search, but as that is only needed at configure time, this generate-time equivalent does not need the condition.
* cmGlobalGenerator: Remove map from cmTarget to cmGeneratorTargetStephen Kelly2015-10-271-23/+3
| | | | | | | 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-11/+28
| | | | Mirror the cmMakefile::FindTarget method.
* cmGlobalGenerator: Add FindGeneratorTarget APIStephen Kelly2015-10-271-0/+48
|
* cmLocalGenerator: Store imported targets in a separate container.Stephen Kelly2015-10-271-0/+1
|
* cmTarget: Implement ALIAS in terms of name mappingStephen Kelly2015-10-271-4/+6
| | | | Remove mapping to cmTarget.
* cmGlobalGenerator: Remove unneeded GetGeneratorTargetStephen Kelly2015-10-271-2/+1
|
* cmGlobalGenerator: Remove direct storage of targetsStephen Kelly2015-10-271-31/+49
| | | | Find the target by looping when needed.
* Port to GetGeneratorTargets.Stephen Kelly2015-10-241-24/+23
|
* cmGlobalGenerator: Move GeneratorTargetsType to usage site.Stephen Kelly2015-10-241-0/+12
|
* cmLocalGenerator: Store a vector of generator targets.Stephen Kelly2015-10-211-1/+1
| | | | Not a map from cmTarget to cmGeneratorTarget.
* Merge topic 'use-generator-target'Brad King2015-10-211-3/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * cmGlobalGenerator: Port IsRootOnlyTarget to cmGeneratorTarget.Stephen Kelly2015-10-201-3/+3
| |
* | cmLocalGenerator: Remove cmGeneratorTargetsType from setter API.Stephen Kelly2015-10-201-3/+1
| |
* | cmLocalGenerator: Don't store imported generator targetsStephen Kelly2015-10-201-1/+0
|/ | | | | No consumers need them. This makes GetGeneratorTargets more comparable to cmMakefile::GetTargets, which does not include imported targets.
* cmGeneratorTarget: Copy IsFrameworkOnApple from cmTarget.Stephen Kelly2015-10-191-1/+2
| | | | Leave the cmTarget method behind for now to implement cmInstallCommand.
* cmExportTryCompileFileGenerator: Port to cmGeneratorTarget.Stephen Kelly2015-10-181-0/+20
|
* cmGlobalGenerator: Compute export() related classes early.Stephen Kelly2015-10-181-2/+1
| | | | Simplify CMP0024 handling.