summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileTargetGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
...
* | Makefiles: Introduce local RelativePath methodStephen Kelly2016-10-061-20/+22
|/ | | | | | | This makes it easier to remove directory-specific state from cmOutputConverter where it doesn't belong. Of course, this just relocates the problem to the makefiles generator for now, but that's better than affecting the core.
* Simplify CMake per-source license noticesBrad King2016-09-271-11/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* Fortran: Use module dir flag if needed for default module directoryBrad King2016-09-201-1/+5
| | | | | | | | | | | | | | Our buildsystem model says that the default Fortran module output directory is the build tree directory corresponding to the source tree `CMakeLists.txt` file adding the current target. Extend `cmGeneratorTarget::GetFortranModuleDirectory` to allow generators to pass in the compiler working directory. If the working directory does not match the default Fortran module output directory then we need an explicit module directory flag (e.g. `-J`) to tell the compiler to put/use modules in the latter. This does not affect the Makefile generator but will be useful for future introduction of Fortran support to the Ninja generator.
* Convert: Inline uses of START_OUTPUTStephen Kelly2016-09-191-24/+40
|
* Convert: Move access to BinaryDirectory out of loopsStephen Kelly2016-09-191-2/+2
|
* Convert: Inline uses of HOME_OUTPUTStephen Kelly2016-09-191-2/+4
|
* Convert: Inline HOME_OUTPUT MAKERULE conversionStephen Kelly2016-09-191-7/+16
|
* Convert: Avoid HOME_OUTPUT enum when converting to relative pathsStephen Kelly2016-09-191-2/+2
|
* Convert: Move access to CurrentBinaryDirectory out of loopsStephen Kelly2016-09-191-4/+7
|
* Convert: Avoid START_OUTPUT enum when converting to relative pathsStephen Kelly2016-09-191-3/+3
|
* Convert: Replace Convert(FULL) with equivalentStephen Kelly2016-08-271-13/+23
| | | | | This is more explicit than funnelling everything through the Convert method.
* Convert: Replace trivial conversion with new methodStephen Kelly2016-08-271-3/+6
|
* Convert: Replace UNCHANGED conversions with new API callStephen Kelly2016-08-271-5/+4
|
* Convert: Replace FULL conversions with equivalentStephen Kelly2016-08-271-9/+6
|
* Convert: Replace uses of Convert(NONE)Stephen Kelly2016-08-271-19/+19
| | | | These are equivalent to ConvertToOutputFormat.
* Makefiles: Change AppendCustomCommand API to stringsStephen Kelly2016-08-271-2/+2
| | | | | Avoid the RelativeRoot enum. Supply the HOME_OUTPUT string at each callsite to make the parameter non-defaulted.
* Makefiles: Change signature of AppendCustomCommandStephen Kelly2016-08-271-2/+2
| | | | The RelativeRoot parameter will become non-default.
* Makefiles: Port CreateCDCommand to string-based APIStephen Kelly2016-08-271-4/+4
|
* fix a batch of include-what-you-use violationsDaniel Pfeifer2016-08-231-5/+12
|
* Makefile: Avoid link line object list lengths nearing system limitsBrad King2016-07-201-0/+39
| | | | | | | Use response files for object file lists that approach the scale of the system `ARG_MAX` limit. Fixes #16206.
* Makefile: Factor out response file checks into common helperBrad King2016-07-201-0/+32
| | | | | | Factor CMAKE_<LANG>_USE_RESPONSE_FILE_FOR_{OBJECTS,LIBRARIES} lookup out into a common helper. Use a separate helper for each because more specific logic may be added to each later.
* Makefile: Factor out WINDOWS_EXPORT_ALL_SYMBOLS helperYury Zhuravlev2016-07-111-0/+43
| | | | | | Factor the implementation out of cmMakefileLibraryTargetGenerator into a helper method in cmMakefileTargetGenerator so it can be re-used elsewhere later.
* Avoid using KWSys auto_ptr by adopting it ourselvesBrad King2016-06-291-1/+1
| | | | | | | | | | | | Replace use of cmsys::auto_ptr with a CM_AUTO_PTR macro that maps to our own implementation adopted from the KWSys auto_ptr implementation. Later we may be able to map CM_AUTO_PTR to std::auto_ptr on compilers that do not warn about it. Automate the client site conversions: git grep -l auto_ptr -- Source/ | grep -v Source/kwsys/ | xargs sed -i \ 's|cmsys::auto_ptr|CM_AUTO_PTR|;s|cmsys/auto_ptr.hxx|cm_auto_ptr.hxx|'
* use CM_NULLPTRDaniel Pfeifer2016-06-281-26/+30
|
* cmGeneratorTarget: Adopt Fortran module directory generationTobias Hunger2016-06-171-1/+1
| | | | | | | | | Move code to create/get the fortran module directory from the cmCommonTargetGenerator to cmGeneratorTarget. Rename the ComputeFortranModuleDirectory method to CreateFortranModuleDirectory as this method *creates* the directory if it is missing.
* Refactor Makefile/Ninja tool working directory storageBrad King2016-06-171-1/+1
| | | | | Move cmCommonTargetGenerator::WorkingDirectory to cmLocalCommonGenerator and add an access method.
* Use the empty() method to check for emptyness.Daniel Pfeifer2016-06-021-1/+1
| | | | | Apply fix-its from clang-tidy's readability-container-size-empty checker.
* Merge topic 'remove-needless-copies'Brad King2016-05-271-1/+1
|\ | | | | | | | | | | 27ead963 Remove unnecessary local copies. 618fb23f Pass arguments that are not modified as const&.
| * Remove unnecessary local copies.Daniel Pfeifer2016-05-261-1/+1
| | | | | | | | | | | | | | 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.
* | Remove redundant c_str() calls.Daniel Pfeifer2016-05-261-7/+5
|/ | | | | Run clang-tidy's readability-redundant-string-cstr checker. Ignore findings in kwsys.
* Merge topic 'improve-character-find-and-replace'Brad King2016-05-251-3/+3
|\ | | | | | | | | | | | | | | 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-3/+3
| | | | | | | | | | Apply fix-its from clang-tidy's performance-faster-string-find checker. Ignore findings in kwsys.
* | Use enums defined in cmOutputConverter using their fully qualified name.Daniel Pfeifer2016-05-251-59/+59
|/ | | | | | | | | 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-760/+544
| | | | | | | | | | | | | 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-29/+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/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Add options to run clang-tidy with the compilerDaniel Pfeifer2016-04-131-3/+16
| | | | | | Create a <LANG>_CLANG_TIDY target property (initialized by a CMAKE_<LANG>_CLANG_TIDY variable) to specify a clang-tidy command line to be run along with the compiler.
* Refactor `.def` file lookupTim Grothe2015-11-041-2/+2
| | | | | Return a `cmSourceFile const*` from GetModuleDefinitionFile so that callers can get more information than just the path to the file.
* Makefiles: Port to cmGeneratorTarget.Stephen Kelly2015-10-241-3/+2
|
* cmLocalGenerator: Port some API to cmGeneratorTarget.Stephen Kelly2015-10-171-3/+4
|
* Use cmGeneratorTarget for property access.Stephen Kelly2015-10-171-3/+3
|
* Use GetName from cmGeneratorTarget.Stephen Kelly2015-10-171-6/+7
|
* Merge topic 'clean-up-cmTarget'Brad King2015-10-161-12/+12
|\ | | | | | | | | | | | | | | | | | | | | | | | | 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 TargetType enum from cmTarget.Stephen Kelly2015-10-141-12/+12
| | | | | | | | | | | | | | 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-6/+6
| |
* | cmLocalGenerator: Port GetTargetDirectory to cmGeneratorTarget.Stephen Kelly2015-10-141-3/+5
| |
* | cmLocalUnixMakefileGenerator3: Port AppendCleanCommand to cmGeneratorTarget.Stephen Kelly2015-10-141-1/+1
| |
* | cmLocalUnixMakefileGenerator3: Port another API to cmGeneratorTarget.Stephen Kelly2015-10-141-5/+5
|/
* cmGeneratorExpression: Port interface to cmGeneratorTarget.Stephen Kelly2015-10-121-1/+3
|