summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileTargetGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* 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`.
* | sourceFile properties: add property INCLUDE_DIRECTORIESMarc Chevrier2018-01-241-2/+20
| |
* | sourceFile properties: add property COMPILE_OPTIONSMarc Chevrier2018-01-231-0/+10
|/ | | | | | | Add the support of per-source property COMPILE_OPTIONS, including generator expressions support. Related: #17507
* Various typo fixesLuz Paz2018-01-031-1/+1
| | | | Some are user-facing. Others are source comments.
* Merge topic 'makefile-simplify-fortran'Brad King2017-12-151-59/+0
|\ | | | | | | | | | | | | | | 7ab9a625 Makefiles: Drop 'requires' step and its supporting infrastructure 5f2e2c38 Makefiles: Avoid nested make calls for Fortran module dependencies Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1523
| * Makefiles: Drop 'requires' step and its supporting infrastructureYurii Batrak2017-12-141-55/+0
| | | | | | | | | | | | | | | | The 'requires' step was used to provide implicit dependencies between the generated Fortran module files and a Fortran target that needs these module files to ensure the correct compilation order. After recent refactoring to resolve all dependencies explicitly through `.mod.stamp` make targets, the separate 'requires' step is not needed anymore.
| * Makefiles: Avoid nested make calls for Fortran module dependenciesYurii Batrak2017-12-141-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Makefiles generated by cmake use a series of nested calls to build `*.provides.build` targets that are used when the 'requires' step is needed. That leads to significant degradation of the build time for incremental builds. Re-arrange dependencies to eliminate the nested calls. Explicit `.mod.stamp` targets introduced by this commit could lead to situation when a stamp file always older than its dependency. This happens during the incremental build when building of an updated Fortran source produces a module file that has no differences from the stored stamp file. In such case `cmake_copy_f90_mod` will be triggered on each new build to compare a module file with the corresponding stamp file. This behavior is expected and can not be changed without nested calls that slow down the build. The copy-if-different check is much cheaper than an entire nested make call.
* | Genex: Per-source $<COMPILE_LANGUAGE:...> supportMarc Chevrier2017-12-131-6/+12
| | | | | | | | Fixes: #17542
* | Add generator expression support to per-source COMPILE_DEFINITIONSMarc Chevrier2017-12-051-5/+6
| | | | | | | | | | | | This allows users to specify different genex-based compile definitions for each file in a target. Fixes: #17508
* | Refactor per-source generator expression evaluationMarc Chevrier2017-12-041-4/+3
| | | | | | | | | | | | Prepare to add generator expression support to more source properties. Factor out some duplicated code into a helper to avoid further duplication.
* | Fortran: Add option to run the compiler through launcher toolsBrad King2017-11-211-2/+2
|/ | | | | | | | | | Add a `Fortran_COMPILER_LAUNCHER` target property like those added for C and CXX by commit v3.4.0-rc1~450^2 (Add options to launch the compiler through tools like ccache or distcc, 2015-06-04) and CUDA by commit v3.10.0-rc1~531^2 (CUDA: Add option to run the compiler through launcher tools, 2017-06-09). Fixes: #17499
* Retire std::auto_ptr and its macro CM_AUTO_PTRMatthias Maennich2017-09-251-4/+4
| | | | Signed-off-by: Matthias Maennich <matthias@maennich.net>
* Meta: replace empty-string assignments with `clear()`.Pavel Solodovnikov2017-09-151-1/+1
|
* Merge topic 'refactor-iwyu-code'Brad King2017-09-151-1/+1
|\ | | | | | | | | | | | | 3bbe95f5 Clean up iwyu code to not be one big if statement. Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1247
| * Clean up iwyu code to not be one big if statement.Bill Hoffman2017-09-131-1/+1
| | | | | | | | | | | | | | | | | | | | This commit changes the internal -E__run_iwyu to be -E__run_co_compile. This is used for co-compile commands. These are tools that want to mirror the compiler. For each compiler invocation the tool will be invoked first. This started as a way to implement include what you use (iwyu), but has expanded to include cpplint, cppcheck and others. Likely there will be more in the future as well. This commit implements each one in its own function and provides a way to add additional ones in the future with less work.
* | Meta: modernize old-fashioned loops to range-based `for`.Pavel Solodovnikov2017-09-121-110/+71
|/ | | | | | Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate.
* Add properties to run cppcheck along with the compilerBill Hoffman2017-08-301-2/+10
| | | | | | Create a `<LANG>_CPPCHECK` target property (initialized by a `CMAKE_<LANG>_CPPCHECK` variable) to specify a `cppcheck` command line to be run along with the compiler.
* Use C++11 nullptrDaniel Pfeifer2017-08-241-21/+21
|
* CUDA: Add option to run the compiler through launcher toolsBrad King2017-06-091-1/+2
| | | | | | | | Add a `CUDA_COMPILER_LAUNCHER` target property like those added for C and CXX by commit v3.4.0-rc1~450^2 (Add options to launch the compiler through tools like ccache or distcc, 2015-06-04). Fixes: #16953
* Pass large types by const&, small types by valueDaniel Pfeifer2017-06-031-2/+2
|
* Access string npos without instancePavel Solodovnikov2017-06-011-1/+3
|
* Merge topic 'enable_ptx_compilation'Brad King2017-04-211-0/+3
|\ | | | | | | | | | | | | 23691d78 CUDA: Allow sources to be compiled to .ptx files Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !725
| * CUDA: Allow sources to be compiled to .ptx filesRobert Maynard2017-04-201-0/+3
| | | | | | | | | | When the target property `CUDA_PTX_COMPILATION` is enabled CUDA OBJECT libraries will generate ptx files instead of object files.
* | Merge topic '16760-refactor-get-mac-content-directory'Brad King2017-04-211-2/+2
|\ \ | | | | | | | | | | | | | | | | | | cf320f7c Replace boolean `implib` parameters with enum Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !662
| * | Replace boolean `implib` parameters with enumGregor Jasny2017-04-201-2/+2
| |/ | | | | | | | | Named enumeration values are much clearer at call sites and add more type safety.
* | Ninja,Makefile: Unify command line limit logicChristian Pfeiffer2017-04-191-14/+1
|/ | | | | | Move the logic to cmSystemTools to be shared among the generators. Revise the implementation and add comments justifying each possible source for a limit.
* Support WINDOWS_EXPORT_ALL_SYMBOLS with `.def` filesBrad King2017-03-211-12/+25
| | | | | | | | | | | The `WINDOWS_EXPORT_ALL_SYMBOLS` target property exports all symbols found in object files explicitly given to the linker. However, the linker may also find additional symbols in dependencies and copy them into the linked binary (e.g. from `msvcrt.lib`). Provide a way to export an explicit list of such symbols by adding a `.def` file as a source file. Fixes: #16473
* Refactor WINDOWS_EXPORT_ALL_SYMBOLS implementationBrad King2017-03-091-42/+32
| | | | | | | Use `cmGeneratorTarget::ModuleDefinitionInfo` to combine the implementation of `WINDOWS_EXPORT_ALL_SYMBOLS` with that of using a `.def` file as a source. Only one of these could be used within a single target before anyway.
* Refactor module definition file selectionBrad King2017-03-091-2/+4
| | | | | | Create a `ModuleDefinitionInfo` structure for each configuration of a target to hold corresponding information about the selected module definition file (`.def` source).
* CUDA: Fix boolean interpretation of CUDA_SEPARABLE_COMPILATIONBrad King2017-02-201-1/+2
| | | | | If the property is explicitly set to a non-true value we should not treat it as true.
* Add properties to run the cpplint style checker with the compilerJamie Snape2017-01-231-1/+9
| | | | | | Create a `<LANG>_CPPLINT` target property (initialized by a `CMAKE_<LANG>_CPPLINT` variable) to specify a `cpplint` style checker command line to be run along with the compiler.
* Makefile,Ninja: De-duplicate MSVC compiler PDB path selectionBrad King2016-12-151-16/+1
| | | | | Add a helper to cmCommonTargetGenerator instead of duplicating it in cmMakefileTargetGenerator and cmNinjaTargetGenerator.
* Merge topic 'fix-ctest-launchers'Brad King2016-12-121-1/+14
|\ | | | | | | | | | | | | db61cd5d cmRulePlaceholderExpander: Remove unused member RuleLauncher b7771078 Comment ExpandRuleVariables calls not preceded by launcher insertion c58a5198 Makefile: Restore RULE_LAUNCH_COMPILE generation on compilation rules
| * Comment ExpandRuleVariables calls not preceded by launcher insertionBrad King2016-12-091-0/+3
| | | | | | | | | | | | | | Call sites of `ExpandRuleVariables` are now responsible for inserting the `RULE_LAUNCH_{COMPILE,LINK,CUSTOM}` values in rule command lines. Audit all call sites and add a comment to each one that does not insert a launcher to explain why.
| * Makefile: Restore RULE_LAUNCH_COMPILE generation on compilation rulesBrad King2016-12-091-1/+11
| | | | | | | | | | | | | | | | Refactoring in commit 425cd167 (cmLocalGenerator: Remove the launcher from RuleVariables, 2016-10-09) accidentally broke Makefile generator handling of `RULE_LAUNCH_COMPILE`. Responsibility moved from `ExpandRuleVariables` to its call sites, and the Makefile generator call site for compilations was not properly updated. Fix it now.
* | Ninja,Makefile: Name static library compile PDB files as VS doesBrad King2016-11-301-0/+7
| | | | | | | | | | | | | | | | | | | | Change the default compile PDB file name for static libraries to match the Visual Studio default of using the logical target name. This may be incompatible with existing behavior but `COMPILE_PDB_NAME` documents that the default is unspecified. Projects depending on a particular name should set the property. Closes: #16438
* | CUDA: Add support for the CUDA_SEPARABLE_COMPILATION target propertyRobert Maynard2016-11-141-6/+15
| |
* | CUDA: State that cuda has preprocessor output and can generate assembly.Robert Maynard2016-11-141-3/+3
| | | | | | | | We can consider PTX code to be a form of assembly.
* | Fix several include-what-you-use findingsDaniel Pfeifer2016-11-081-8/+6
| |
* | Add generator expression support to per-source COMPILE_FLAGSZsolt Parragi2016-10-281-7/+9
| | | | | | | | | | | | This allows users to specify different genex-based compile flags for each file in a target, e.g. compiling just a single file with `Od/Ox` in release builds on Visual Studio.
* | cmListFileCache: Remove cmState header includeStephen Kelly2016-10-191-0/+1
| | | | | | | | | | Include it in dependents which have previously relied on it transitively.
* | cmState: Port dependents to new cmStateTypes headerStephen Kelly2016-10-191-1/+1
| |
* | cmState: Port dependent code to new cmStateDirectory nameStephen Kelly2016-10-191-3/+3
| |
* | cmState: Move TargetType enum to separate namespaceStephen Kelly2016-10-191-12/+12
|/