summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaNormalTargetGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Retire std::auto_ptr and its macro CM_AUTO_PTRMatthias Maennich2017-09-251-5/+5
| | | | Signed-off-by: Matthias Maennich <matthias@maennich.net>
* Meta: replace empty-string assignments with `clear()`.Pavel Solodovnikov2017-09-151-3/+3
|
* 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-36/+24
|/ | | | | | Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate.
* Ninja: Implement support for GNUToMSAlbert Ziegenhagel2017-08-251-1/+10
| | | | | | Port the implementation from `cmMakefileTargetGenerator::GetLinkRule`. Fixes: #13870
* Use C++11 nullptrDaniel Pfeifer2017-08-241-1/+1
|
* Ninja: Fix generated command lines for cmake_symlink_* on WindowsNils Gladitz2017-06-231-4/+12
| | | | | | CMake generates multiple commands cojoined with &&. On Windows this only works when executing the commands through the Windows shell.
* IPO: Consider support for each language separatelyBrad King2017-06-141-2/+2
| | | | | | | | | We only define `INTERPROCEDURAL_OPTIMIZATION` behavior for C, CXX, and Fortran languages. Do not try to enable support for other languages. Furthermore, each language builds with a different compiler, so check for support by CMake and the compiler for each language independently. Fixes: #16944
* cmLocalGenerator: Add a hook for compiler flags used at link timeBrad King2017-05-011-2/+4
| | | | | | | | | | | | When using a compiler to drive linking we add compiler flags from `CMAKE_<LANG>_FLAGS` in case they affect the way the compiler invokes the linker, but we don't add flags from other places that are meant only for compiling sources. Rather than calling the `AddLanguageFlags` method (which is used to add flags for compiling sources) directly, add an intermediate method that is used when adding the flags for linking. This will give us a way to add language-specific compiler flags needed when driving the linker in the same place on the command line as other compiler flags go.
* Add IPO compiler flags more consistently in generatorsBrad King2017-04-271-2/+2
| | | | | | Move addition of IPO flags into `cmLocalGenerator::AddLanguageFlags` because all call sites of that need the IPO flags, but not all were following the call with `AppendFeatureOptions`.
* CUDA: Static libraries can now explicitly resolve device symbolsRobert Maynard2017-04-261-1/+6
| | | | | | | If a static library has the property CUDA_RESOLVE_DEVICE_SYMBOLS enabled it will now perform the device link step. The normal behavior is to delay calling device link until the static library is consumed by a shared library or an executable.
* Merge topic '16760-refactor-get-mac-content-directory'Brad King2017-04-211-14/+10
|\ | | | | | | | | | | | | 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-14/+10
| | | | | | | | | | Named enumeration values are much clearer at call sites and add more type safety.
* | Ninja,Makefile: Unify command line limit logicChristian Pfeiffer2017-04-191-40/+6
|/ | | | | | Move the logic to cmSystemTools to be shared among the generators. Revise the implementation and add comments justifying each possible source for a limit.
* Merge topic 'ipo-policy-CMP0069'Brad King2017-03-311-0/+8
|\ | | | | | | | | | | | | | | | | | | | | | | dfa8263f Implement interprocedural optimization for GNU compilers 1588a577 Add policy CMP0069 to enforce INTERPROCEDURAL_OPTIMIZATION a7575700 Refactoring: s,GetFeatureAsBool,IsIPOEnabled, e05835c3 CheckIPOSupported: Visual Studio and Xcode generators do not support IPO Acked-by: Kitware Robot <kwrobot@kitware.com> Reviewed-by: Brad King <brad.king@kitware.com> Reviewed-by: Nils Gladitz <nilsgladitz@gmail.com> Merge-request: !568
| * Implement interprocedural optimization for GNU compilersRuslan Baratov2017-03-301-0/+8
| | | | | | | | | | Honor the `INTERPROCEDURAL_OPTIMIZATION` target property for GNU compilers by activating their link-time-optimization (LTO) flags.
* | Merge topic 'ninja-fix-sysconf-non-limit'Brad King2017-03-281-5/+9
|\ \ | |/ |/| | | | | | | | | 92fe00d3 Ninja: Fix command line limit when sysconf has no ARG_MAX Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !633
| * Ninja: Fix command line limit when sysconf has no ARG_MAXChristian Pfeiffer2017-03-271-5/+9
| | | | | | | | | | | | | | | | | | The `sysconf(3)` manual explains that the return value can be `-1` for limits if there is no definite limit. Recognize this case and skip using the value as a limit candidate. Otherwise we use response files unconditionally on such systems instead of checking other limits. Fixes: #16740
* | Merge topic 'cuda_no_ninja_response_support'Brad King2017-03-221-6/+7
|\ \ | |/ | | | | | | | | | | feaea065 CUDA: Disable support for using response files. Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !596
| * CUDA: Disable support for using response files.Robert Maynard2017-03-211-6/+7
| |
* | Support WINDOWS_EXPORT_ALL_SYMBOLS with `.def` filesBrad King2017-03-211-5/+15
| | | | | | | | | | | | | | | | | | | | | | 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-40/+21
| | | | | | | | | | | | | | 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.
* | cmAlgorithms: add cmEraseIf functionDaniel Pfeifer2017-02-101-12/+6
|/
* CUDA: Don't use module definition `.def` files for device linkingRobert Maynard2017-01-121-1/+0
| | | | These files are meaningful only to the host linker.
* CUDA: Populate compiler PDB placeholder during device linkingBrad King2017-01-121-0/+3
| | | | | The device link step runs the host compiler internally so we need to use the proper compiler PDB file with MSVC.
* CUDA: Use `.obj` object file extension on WindowsBrad King2017-01-121-2/+4
|
* clang-tidy: apply modernize-use-bool-literals fixesDaniel Pfeifer2016-12-121-1/+1
|
* Merge topic 'initial_cuda_language_support'Brad King2016-11-291-0/+358
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4cc601f2 Help: Add release note for CUDA support 7b9131da CUDA: Add tests to verify CUDA compiler works properly. 9cf5b98d CUDA: Prefer environment variables CUDACXX and CUDAHOSTCXX. a5e806b3 CUDA: Add support for CMAKE_CUDA_COMPILE_OPTIONS_VISIBILITY d038559e CUDA: Add separable compilation support to the makefile generator. 43ce4414 CUDA: Add separable compilation support to the ninja generator. 4b316097 CUDA: Add support for the CUDA_SEPARABLE_COMPILATION target property ae05fcc6 CUDA: Add LinkLineComputer that computes cuda dlink lines. 115269a8 CUDA: Refactor cmLinkLineComputer to allow for better derived children. 5dec4031 CUDA: Refactor CMakeCUDAInformation to prepare for separable compilation. 5b20d0ab CUDA: C++ compile features now enable cuda c++11 support. 489c52ce CUDA: Use the host compiler for linking CUDA executables and shared libs. bbaf2434 CUDA: add support for specifying an explicit host compiler. a92f8d96 CUDA: Enable header dependency scanning. ec6ce623 CUDA: State that cuda has preprocessor output and can generate assembly. 4f5155f6 CUDA: We now properly perform CUDA compiler identification. ...
| * CUDA: Add separable compilation support to the ninja generator.Robert Maynard2016-11-141-0/+358
| |
* | Ninja: Document why ComputeLinkCmd is structured the way it is.Robert Maynard2016-11-141-0/+3
|/
* Fix several include-what-you-use findingsDaniel Pfeifer2016-11-081-9/+12
|
* Ninja: Fix POST_BUILD noop on WindowsBrad King2016-10-281-1/+1
| | | | | | Use `cd .` instead of `:` in a Windows shell. Closes: #16393
* Merge topic 'ninja-only-object-rules'Brad King2016-10-201-3/+4
|\ | | | | | | | | 3a9e92bc Ninja: Add compile rules only for languages that are actually compiled
| * Ninja: Add compile rules only for languages that are actually compiledBrad King2016-10-181-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | In `WriteLanguageRules` we collect all languages used for source files in a target. However, this only needs to include sources that are actually going to be compiled into object files. No object file build statements will be generated for other sources. This avoids generating language compile rules for source files that are not compiled due to being marked as `HEADER_FILE_ONLY`. Issue: #16373
* | 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: Move TargetType enum to separate namespaceStephen Kelly2016-10-191-22/+22
|/
* cmRulePlaceholderExpander: Port clients to direct-useStephen Kelly2016-10-151-3/+7
| | | | | | Add a factory function to cmLocalGenerator so that variableMappings can be provided from it, and so that Ninja can always have a hard-coded TargetImpLib.
* cmLocalGenerator: Use strings instead of a Target in rule replacementStephen Kelly2016-10-151-1/+4
| | | | Don't rely on the cmGeneratorTarget type needlessly.
* cmLocalGenerator: Use a converter in rule replacement APIStephen Kelly2016-10-151-1/+2
| | | | | | | The rule replacement API should not really be in cmLocalGenerator, but it was historically, and this coupled many other things together here too, such as output conversion. Make the output converter a parameter so that rule replacement can be removed from cmLocalGenerator.
* cmLocalGenerator: Remove the launcher from RuleVariablesStephen Kelly2016-10-151-1/+9
| | | | | | | | | This one is not like the others as it doesn't participate in substitutions. Keep ExpandRuleVariables doing only one thing and make callers responsible for inserting a launcher prefix, simplifying the code all-around. Remove now-obsolete InsertRuleLauncher method.
* Merge topic 'ninja-framework-POST_BUILD'Brad King2016-10-141-2/+4
|\ | | | | | | | | 20278872 Ninja: Fix POST_BUILD commands on macOS Frameworks
| * Ninja: Fix POST_BUILD commands on macOS FrameworksBrad King2016-10-131-2/+4
| | | | | | | | | | | | | | | | | | | | The condition added by commit v2.8.12~179^2 (OS X: Fix regression handling frameworks for Ninja, 2013-07-16) for excluding use of versioning symlinks on macOS Frameworks must match that used for POST_BUILD selection. Otherwise we place the POST_BUILD commands after a symlink step that is never added. Closes: #16363
* | Honor LINK_WHAT_YOU_USE when set to OFFJamie Snape2016-10-131-2/+2
| | | | | | | | | | | | Explicitly setting variable CMAKE_LINK_WHAT_YOU_USE or property LINK_WHAT_YOU_USE to OFF should not cause LWYU to run. Fix the property lookup to use GetPropertyAsBool.
* | cmLinkLineComputer: Move FrameworkPath computation from cmLocalGeneratorStephen Kelly2016-10-101-4/+4
| | | | | | | | Add UseWatcomQuote state, and remove corresponding method parameters.
* | cmLinkLineComputer: Move ComputeLinkLibs from cmLocalGeneratorStephen Kelly2016-10-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a cmOutputConverter to the cmLinkLineComputer and factory methods to facilitate shell escapes. Add state to the cmLinkLineComputer to record whether outputting for response files or for watcom, to satisfy the cmOutputConverter API. These are constant for the lifetime of the cmLinkLineComputer, even when its functionality is extended in the future. This also keeps the signatures of cmLinkLineComputer relatively simple. Pass the cmComputeLinkInformation as a method parameter so that cmLinkLineComputer is free from target-specific state. An instance should be usable for all targets in a directory.
* | cmLinkLineComputer: Extract from cmLocalGeneratorStephen Kelly2016-10-101-4/+10
|/ | | | | | | | | | | CMake has several classes which have too many responsibilities. cmLocalGenerator is one of them. Start to extract the link line computation. Create generator-specific implementations of the interface to account for generator-specific behavior. Unfortunately MSVC60 has different behavior to everything else and CMake still generates makefiles for it. Isolate it with MSVC60-specific names.
* Simplify CMake per-source license noticesBrad King2016-09-271-12/+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.
* cmGlobalNinjaGenerator: Teach WriteBuild about implicit outputsBrad King2016-09-201-3/+6
| | | | | | | | Ninja 1.7 introduced support for implicit outputs on build statements. Teach WriteBuild to generate the corresponding syntax. Leave it up to callers to decide whether implicit outputs are supported by the Ninja version in use. For now simply update all call sites to pass an empty list of implicit outputs.