summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileTargetGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Precompile headers: Add methods to generate PCH sourcesCristian Adam2019-08-281-1/+19
| | | | Co-Author: Daniel Pfeifer <daniel@pfeifer-mail.de>
* Merge topic 'pvs-cleanup'Brad King2019-08-261-4/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 7fe3e874d5 cmCPackLog: Fix support for multiple log message tags 74f2c0ea56 cmCTestTestHandler: Remove extra layer of parentheses 7c2767ef3b cmCTestMultiProcessHandler: Explain testRun ownership in comments 303e813438 CTest: Simplify some boolean conditions 51565abe79 cmMessageCommand: Remove extra layer of parentheses b1cfaf7b91 cmVSSetupHelper: Remove unused SmartBSTR copy operations 3f4c4e7afe cmVSSetupHelper: Fix SmartBSTR copy operations a8ca5aea94 cmMakefileTargetGenerator: Check for null before using a pointer ... Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Daniel Pfeifer <daniel@pfeifer-mail.de> Acked-by: Artalus <artalus-mail@yandex.ru> Merge-request: !3715
| * cmMakefileTargetGenerator: Check for null before using a pointerBrad King2019-08-261-4/+4
| | | | | | | | | | | | | | | | Fix the order of logic added by commit 7740ccd1a4 (ENH: some cleanup of the makefile generator, 2006-02-14, v2.4.0~517) to check for allocation failure ('new' returns null) before using the pointer. Issue: #19610
* | Source sweep: Replace cmExpandList with the shorter cmExpandedListSebastian Holtermann2019-08-231-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | This replaces the code pattern ``` std::vector<std::string> args; cmExpandList(valueStr, args, ...) ``` with ``` std::vector<std::string> args = cmExpandedList(valueStr, ...) ```
* | Source sweep: Use cmStrCat for string concatenationSebastian Holtermann2019-08-221-131/+100
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is generated by a python script that uses regular expressions to search for string concatenation patterns of the kind ``` std::string str = <ARG0>; str += <ARG1>; str += <ARG2>; ... ``` and replaces them with a single `cmStrCat` call ``` std::string str = cmStrCat(<ARG0>, <ARG1>, <ARG2>, ...); ``` If any `<ARGX>` is itself a concatenated string of the kind ``` a + b + c + ...; ``` then `<ARGX>` is split into multiple arguments for the `cmStrCat` call. If there's a sequence of literals in the `<ARGX>`, then all literals in the sequence are concatenated and merged into a single literal argument for the `cmStrCat` call. Single character strings are converted to single char arguments for the `cmStrCat` call. `std::to_string(...)` wrappings are removed from `cmStrCat` arguments, because it supports numeric types as well as string types. `arg.substr(x)` arguments to `cmStrCat` are replaced with `cm::string_view(arg).substr(x)`
* Source sweep: Use cmIsOn instead of cmSystemTools::IsOnSebastian Holtermann2019-08-171-4/+4
| | | | | | | | | This replaces invocations of - `cmSystemTools::IsInternallyOn` with `cmIsInternallyOn` - `cmSystemTools::IsNOTFOUND` with `cmIsNOTFOUND` - `cmSystemTools::IsOn` with `cmIsOn` - `cmSystemTools::IsOff` with `cmIsOff`
* Source code: Use cmExpandList instead of cmSystemTools::ExpandListArgumentSebastian Holtermann2019-08-141-11/+10
|
* clang-tidy: Enable performance-inefficient-string-concatenationSebastian Holtermann2019-08-051-1/+1
| | | | | | | Enables the clang-tidy test performance-inefficient-string-concatenation and replaces all inefficient string concatenations with `cmStrCat`. Closes: #19555
* cmStringAlgorithms: Move string functions to the new cmStringAlgorithms.hSebastian Holtermann2019-07-291-0/+1
| | | | | This adds the `cmStringAlgorithms.h` header and moves all string functions from `cmAlgorithms.h` to `cmStringAlgorithms.h`.
* IWYU: Fix handling of <memory> standard headerBrad King2019-07-101-1/+1
| | | | | | | | An old workaround for `std::allocator_traits<>::value_type` lints from IWYU on `std::vector<>` usage breaks IWYU's handling of `<memory>`. Convert the workaround to use the same approach we already use for a workaround of `std::__decay_and_strip<>::::__type` lints. Then update the `<memory>` inclusions to follow the now-correct IWYU lints.
* Use cmAppend to append ranges to std::vector instancesSebastian Holtermann2019-05-231-22/+10
|
* Ninja,Makefile: Fix <LANG>_COMPILER_LAUNCHER shell command syntaxBrad King2019-05-221-2/+6
| | | | | | | | | The first entry in the compiler launcher command argument list is the command itself and should be converted to the shell's native command syntax (e.g. backslashes on Windows). Without this, the `RunCMake.CompilerLauncher` test fails on Windows when there are *no* spaces in the path to `cmake.exe`.
* Makefiles: Process ADDTIONAL_CLEAN_FILES dir prop at directory levelSebastian Holtermann2019-05-181-12/+0
| | | | | | | | | | | | | | In the "Unix Makefiles" generator, the `ADDTIONAL_CLEAN_FILES` directory property was evaluated on a per target basis. This had two drawbacks: - per directory clean files were repeated in every target clean script - per directory clean files weren't removed in directories without targets (issue #8164) This patch moves the `ADDTIONAL_CLEAN_FILES` directory property processing from the target to the directory level clean target. Fixes: #8164 "ADDITIONAL_CLEAN_FILES directory property not respected if no target present in directory"
* Merge topic 'string-cleanup'Brad King2019-05-171-2/+3
|\ | | | | | | | | | | | | | | 23e8364aed Source: std::string related cleanup Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Sebastian Holtermann <sebholt@web.de> Merge-request: !3324
| * Source: std::string related cleanupVitaly Stakhovsky2019-05-151-2/+3
| |
* | Makefiles: Add support for ADDITIONAL_CLEAN_FILES target propertySebastian Holtermann2019-05-141-0/+12
| |
* | Makefiles: Add support for ADDITIONAL_CLEAN_FILES directory propertySebastian Holtermann2019-05-141-0/+12
| |
* | Makefiles: Move ADDITIONAL_MAKE_CLEAN_FILES evaluation to lambdaSebastian Holtermann2019-05-141-10/+16
| |
* | Makefiles: Sort clean files by using a std::set<std::string> containerSebastian Holtermann2019-05-141-8/+9
|/ | | | | | | By using a `std::set<std::string>` container instead of a `std::vector<std::string>` container, the clean files list becomes sorted and unique. The clean target in Makefiles beomes nicer and better readable this way. Also double clean entries won't appear anymore.
* cmRange: Move to dedicated header fileRegina Pfeifer2019-02-211-0/+1
|
* Merge topic 'modernize-for-loops'Brad King2019-02-111-6/+5
|\ | | | | | | | | | | | | | | | | 01b2d6ab74 Modernize: Use ranged for-loops when possible 15bdbec017 cmAlgorithms: Make cmRange advance/retreat safe for rvalues Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Daniel Pfeifer <daniel@pfeifer-mail.de> Merge-request: !2901
| * Modernize: Use ranged for-loops when possibleArtur Ryt2019-02-071-6/+5
| | | | | | | | | | | | | | Replaced most manual `const_iterator`-based loops and some reverse-iterator loops with range loops. Fixes: #18858
* | cmMakefile::GetRequiredDefinition: return const std::string&Vitaly Stakhovsky2019-02-071-7/+8
|/
* cmSystemTools::Message: Add overload accepting std::stringVitaly Stakhovsky2019-01-281-1/+1
|
* Merge topic 'cmake-files-directory'Brad King2019-01-251-1/+1
|\ | | | | | | | | | | | | | | 3e867ed400 cmake: inlined files dir constant and removed it from cmake.h Acked-by: Kitware Robot <kwrobot@kitware.com> Rejected-by: vvs31415 <vstakhovsky@fastmail.com> Merge-request: !2655
| * cmake: inlined files dir constant and removed it from cmake.hBruno Manganelli2019-01-211-1/+1
| |
* | cmLocalUnixMakefileGenerator3: more methods accept std::stringVitaly Stakhovsky2019-01-221-6/+5
| |
* | clang-tidy: Use emplaceRegina Pfeifer2019-01-171-1/+1
|/
* Merge topic 'nmake-compile-commands'Craig Scott2019-01-071-0/+11
|\ | | | | | | | | | | | | | | 37c6a02dc2 CMake: fix nmake compile_commands generation 7583f7490e cmGlobalGenerator: Teach EscapeJSON to escape newlines and tabs Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2648
| * CMake: fix nmake compile_commands generationYan Pashkovsky2018-12-141-0/+11
| |
* | cmOutputConverter: Moved ContainedInDirectory to cmStateDirectoryBruno Manganelli2018-12-081-2/+1
| |
* | cmOutputConverter: Moved ForceToRelativePath to cmSystemBruno Manganelli2018-12-071-1/+1
| |
* | clang-tidy: Fix readability-static-accessed-through-instanceRegina Pfeifer2018-11-211-4/+6
|/ | | | Enable the check in .clang-tidy and fix all warnings.
* POSITION_INDEPENDENT_CODE: Manage link flags for executablesMarc Chevrier2018-11-111-0/+3
| | | | Fixes: #14983, #16561
* Using front() and back() instead of calculationsCengizhan Pasaoglu2018-11-061-1/+1
|
* Makefile: Add build events byproducts to clean rulesPedro Navarro2018-09-281-0/+24
|
* Makefile: Add custom command byproducts to clean rulesPedro Navarro2018-09-281-0/+6
|
* genex: Simplify cmGeneratorExpressionInterpreterBrad King2018-09-071-2/+1
| | | | | | | | | All callers were constructing with a non-empty target name using the target whose pointer was passed anyway. Drop this argument. Simplify logic accordingly. Re-order constructor arguments to match the cmCompiledGeneratorExpression::Evaluate arguments. Also remove unnecessary getters.
* Genex: Return Evaluate results as const std::string&Vitaly Stakhovsky2018-08-281-5/+5
| | | | Also remove unused overloads.
* cmGeneratedFileStream: clang-tidy applied to remove redundant ``c_str`` callsSebastian Holtermann2018-08-071-9/+7
| | | | | | | | | | | | | | | After changing the ``cmGeneratedFileStream`` methods to accept ``std::string const&`` instead of ``const char*`` we don't need to call ``std::string::c_str`` anymore when passing a ``std::string`` to a ``cmGeneratedFileStream`` method. This patch removes all redundant ``std::string::c_str`` calls when passing a string to a ``cmGeneratedFileStream`` method. It was generated by building CMake with clang-tidy enabled using the following options: -DCMAKE_CXX_CLANG_TIDY=/usr/bin/clang-tidy-4.0;-checks=-*,readability-redundant-string-cstr;-fix;-fix-errors
* LINK_DEPENDS: add support for property INTERFACE_LINK_DEPENDSMarc Chevrier2018-06-271-5/+3
| | | | Fixes: #17997
* LINK_OPTIONS: Add new family of propertiesMarc Chevrier2018-06-061-1/+7
| | | | | | | | | | | | | | This family enable to manage link flags Three new properties: * directory property: LINK_OPTIONS * target properties: LINK_OPTIONS and INTERFACE_LINK_OPTIONS Two new commands * add_link_options(): to populate directory property * target_link_options(): to populate target properties Fixes: #16543
* Makefile generator: link flags management refactoringMarc Chevrier2018-06-061-0/+11
|
* Revise C++ coding style using clang-format-6.0Kitware Robot2018-06-011-6/+8
| | | | | | | | | | | | Run the `clang-format.bash` script to update all our C and C++ code to a new style defined by `.clang-format`. Use `clang-format` version 6.0. * 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.
* cmGeneratorTarget: Make import library checks config-awareMichael Stürmer2018-04-051-1/+1
|
* Fix combined use of compiler launcher with lint toolsIlya A. Kriveshko2018-02-271-14/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using ccache with clang-tidy, ccache needs to wrap compiler invocation, rather than cmake invocation. But it needs to do it without affecting the command line that iwyu-like tools are receiving. With this fix, if __run_co_compile is used, compile launcher is passed using the new --launcher option, but if __run_co_compile is not needed, compiler launcher is prepended to the command line as before. To better illustrate the change: with this fix if running clang-tidy with CXX_COMPILER_LAUNCHER set to "/usr/bin/time;-p;ccache" (time -p added strictly for illustration purposes), the command line changes from: /usr/bin/time -p ccache cmake -E __run_co_compile \ --tidy=clang-tidy ... -- g++ ... to: cmake -E __run_co_compile \ --launcher="/usr/bin/time;-p;ccache" \ --tidy=clang-tidy ... -- g++ ... This allows the compiler to be run via the launcher, but leaves tidy (& friends) invocations unaffected. Fixes: #16493
* Reduce raw string pointers usage.Pavel Solodovnikov2018-01-311-18/+10
| | | | | | | | | | * Change some functions to take `std::string` instead of `const char*` in the following classes: `cmMakeFile`, `cmake`, `cmCoreTryCompile`, `cmSystemTools`, `cmState`, `cmLocalGenerator` and a few others. * Greatly reduce using of `const char*` overloads for `cmSystemTools::MakeDirectory` and `cmSystemTools::RelativePath`. * Remove many redundant `c_str()` conversions throughout the code.
* Reduce allocation of temporary values on heap.Pavel Solodovnikov2018-01-261-10/+10
| | | | | - Use `std::move` while inserting temporary results into vectors. - Change `push_back` to `emplace_back` where appropriate.
* Merge topic 'xl-qoptfile'Brad King2018-01-251-1/+8
|\ | | | | | | | | | | | | | | c4dc6485 XL: Enable use of response files for includes and objects e342e410 Makefile,Ninja: Use tool-specific response file flag for include dirs Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1691
| * Makefile,Ninja: Use tool-specific response file flag for include dirsBrad King2018-01-241-1/+8
| | | | | | | | | | | | | | When we use a response file for `-I` flags, not all compilers support the `@<file>` syntax. Define `CMAKE_<LANG>_RESPONSE_FILE_FLAG` to specify tool-specific flag, just as we do for linking already via `CMAKE_<LANG>_RESPONSE_FILE_LINK_FLAG`.