summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaNormalTargetGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Merge topic 'swift-flags'Brad King2019-05-231-0/+11
|\ | | | | | | | | | | | | 02c14b7fcd Ninja,Swift: pass along DEFINES/FLAGS/INCLUDES Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3355
| * Ninja,Swift: pass along DEFINES/FLAGS/INCLUDESSaleem Abdulrasool2019-05-211-0/+11
| | | | | | | | | | | | | | Since the Swift model does a single compile/link phase, we would not get the compile definitions, includes, and options past along to the build of the module. Compute these for the target when constructing the main command.
* | Merge topic 'remove_unneeded_device_link_calls'Brad King2019-05-221-26/+4
|\ \ | | | | | | | | | | | | | | | | | | | | | 81b4d10d8f CUDA: More exhaustive checks to determine when to do device linking 3205c7c950 cmNinjaLinkLineDeviceComputer now lives in the correct source file Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3320
| * | CUDA: More exhaustive checks to determine when to do device linkingRobert Maynard2019-05-211-26/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Previously CMake used fairly naive logic to determine when to do device linking which caused unnecessary device linking to occur frequently. We now use a more exhaustive algorithm to determine when we have a need for device linking. Fixes: #19238
| * | cmNinjaLinkLineDeviceComputer now lives in the correct source fileRobert Maynard2019-05-201-1/+1
| | |
* | | Merge topic 'swift-debug-variant'Brad King2019-05-221-13/+10
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | 62381effba Ninja,Swift: reuse `SWIFT_MODULE_NAME` for `SWIFT_MODULE` Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3343
| * | | Ninja,Swift: reuse `SWIFT_MODULE_NAME` for `SWIFT_MODULE`Saleem Abdulrasool2019-05-201-13/+10
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | Rather than compute the value of `SWIFT_MODULE`, use the computed value of `SWIFT_MODULE_NAME`. This is helpful strictly for Windows where you have multiple configuration variants with differing ABIs that need must co-exist. In particular, this re-use permits the use of `CMAKE_DEBUG_POSTFIX` to have the import library and the DLL be named with the trailing suffix but have the same import name for the swift module and interface.
* | | Merge topic 'ninja-lib-symlink-space'Brad King2019-05-221-1/+3
|\ \ \ | |/ / |/| | | | | | | | | | | | | | 13c92b4a30 Ninja: Fix creation of library symlinks in folders with spaces Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3341
| * | Ninja: Fix creation of library symlinks in folders with spacesEike Ziller2019-05-201-1/+3
| | | | | | | | | | | | | | | The arguments to 'cmake -E cmake_symlink_library' must be properly quoted.
* | | Merge topic 'ninja-swift'Brad King2019-05-201-26/+76
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a9180ccf9a Tests: add a check for the Swift compiler d745551fb6 Help: add some initial documentation for Swift support 9a182c9e5b Auxiliary: update vim syntax highlighting e9b0063e8e Modules: add build rules for Swift Ninja support b6412e3e38 Ninja: add placeholders to support Swift build 7d7f31161d Ninja: add support for Swift's output-file-map.json d688c4c19d Swift: remove unnecessary unreleased Ninja infrastructure 0723582208 Swift: Detect compiler version ... Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3297
| * | Ninja: add placeholders to support Swift buildSaleem Abdulrasool2019-05-161-1/+84
| | | | | | | | | | | | Add the placeholders needed to support compiling Swift code.
| * | Swift: remove unnecessary unreleased Ninja infrastructureSaleem Abdulrasool2019-05-161-33/+0
| |/ | | | | | | | | | | This cleans up the new options that were added to support Swift. This was not released, and the proper support approach that we settled upon does not require as much specialised support.
* | Merge topic 'string-cleanup'Brad King2019-05-171-1/+1
|\ \ | |/ |/| | | | | | | | | | | 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-1/+1
| |
* | Ninja: Add support for ADDITIONAL_CLEAN_FILES target propertySebastian Holtermann2019-05-141-0/+2
|/
* Merge topic 'touch-after-ranlib'Brad King2019-05-071-0/+14
|\ | | | | | | | | | | | | f83e4359f2 Apple: Preserve high resolution mtime for static libraries Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3283
| * Apple: Preserve high resolution mtime for static librariesGregor Jasny2019-05-051-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | On macOS ranlib truncates the fractional part of the static achive file modification time. If the archive and at least one contained object file were created within the same second this will make look the archive older than the object file. On subsequent ninja runs this leads to re-achiving and updating dependent targets. As a work-around we touch the archive after ranlib. Closes: #19222
* | Ninja,Makefile: use `unique_ptr` for memory managementSaleem Abdulrasool2019-04-181-5/+2
| | | | | | | | | | Use a `unique_ptr` to manage the lifetime of the `MacOSXContentGenerator` and 'OSXBundleGenerator` rather than manually handling the lifetime.
* | cmTarget: Move member `*Commands` to implSebastian Holtermann2019-03-231-2/+1
| |
* | Merge topic 'error-consolidate'Brad King2019-02-251-2/+2
|\ \ | | | | | | | | | | | | | | | | | | 9dd255548d cmSystemTools::Error: consolidate parameters into single std::string Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2995
| * | cmSystemTools::Error: consolidate parameters into single std::stringVitaly Stakhovsky2019-02-201-2/+2
| | |
* | | Ninja: add final placeholders to merge Swift partialsSaleem Abdulrasool2019-02-201-0/+33
|/ / | | | | | | | | | | This adds the placeholders that are needed to merge the swift partial modules. It permits generating the rules necessary to actually merge the partial modules emitted for a partial compilation.
* | Ninja: remove duplicate local variable (NFC)Saleem Abdulrasool2019-02-181-12/+10
| | | | | | | | Remove the second reference to the generator target.
* | Create and use `cmGeneratorTarget::Names`Saleem Abdulrasool2019-02-111-19/+17
|/ | | | | | Rather than taking a number of out parameters for the various names, create a structure that is reused for both `GetLibraryNames` and `GetExecutableNames`. Replace uses according to the new interface.
* CUDA: Honor CUDA_RESOLVE_DEVICE_SYMBOLS for more target typesRobert Maynard2019-02-051-14/+15
| | | | | | | `CUDA_RESOLVE_DEVICE_SYMBOLS` can be used with shared, module, and executable target types. This relaxation is to allow for better interoperability with linkers that automatically do CUDA device symbol resolution and have no way to disable it.
* Merge topic 'cmake-files-directory'Brad King2019-01-251-5/+2
|\ | | | | | | | | | | | | | | 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-5/+2
| |
* | clang-tidy: Use emplaceRegina Pfeifer2019-01-171-3/+3
|/
* IWYU: Update CMake code for IWYU built with Clang 6Brad King2019-01-151-0/+1
| | | | | IWYU now correctly requires `<utility>` for `std::move`. It also requires a container header when used via a range-based for loop.
* clang-tidy: Remove redundant member initializationsRegina Pfeifer2018-12-151-6/+0
|
* Merge topic 'cuda-external'Brad King2018-12-061-0/+4
|\ | | | | | | | | | | | | 7b74213461 CUDA: Fix crash on linking to a CUDA target without CUDA enabled Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2704
| * CUDA: Fix crash on linking to a CUDA target without CUDA enabledBrad King2018-12-051-0/+4
| | | | | | | | | | | | | | | | Do not try to device link or add CUDA runtime libraries if the language is not enabled. Fixes: #18673 Issue: #18614
* | cmNinjaNormalTargetGenerator: don't use `|| true` for link-what-you-useBen Boeckel2018-11-021-1/+0
|/ | | | | | | | With the `|| true`, a linker error before running link-what-you-use would also use the `|| true` fragment and unconditionally succeed. Just skip the addition since `--lwyu=` ignores the return value anyways. Fixes #18524
* cmMakefile: Make GetRequiredDefinition return std::stringVitaly Stakhovsky2018-09-051-2/+2
| | | | | | | In all cases the return value is converted to std::string anyway. Also remove unnecessary `c_str()` calls in arguments to `GetRequiredDefinition`.
* cmGeneratedFileStream: clang-tidy applied to remove redundant ``c_str`` callsSebastian Holtermann2018-08-071-1/+1
| | | | | | | | | | | | | | | 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-2/+2
| | | | Fixes: #17997
* Ninja: Use native slashes to pass rsp filesMatthijs Kool2018-06-081-4/+4
| | | | | Some tools on Windows (e.g. Embarcadero linkers) can't handle forward slashes in paths to rsp files.
* Revise C++ coding style using clang-format-6.0Kitware Robot2018-06-011-11/+15
| | | | | | | | | | | | 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-2/+2
|
* CUDA: Pass more link libraries to device linkingRobert Maynard2018-03-281-1/+1
| | | | | | | | | | | | | | | | | Previously we dropped non-target items from the device link line because nvcc rejects paths to shared library files, and only with target items do we know the kind of library. However, this also prevents projects from linking to system-provided libraries like `cublas_device` that contain device code. Fix this by passing more link items to device linking. Items that are not file paths, such as `-lfoo`, can simply be passed unconditionally. Items that are targets known to be shared libraries can still be skipped. Items that are paths to library files can be passed directly if they end in `.a`. Otherwise, pass them using `-Xnvlink` to bypass nvcc's front-end. The nvlink tool knows to ignore shared library files. Issue: #16317
* Ninja: Generate scripts for long custom command sequencesRoger Leigh2018-02-061-2/+4
| | | | | | | | | | | | Ninja runs just one command line for every build statement, so the Ninja generator needs to `&&`-chain multiple commands together into one long string. For long custom command sequences this can exceed the maximum command-line length for the operating system. In such cases, write the commands out to a script instead, and then run the script from Ninja's one command line. Co-Author: Brad King <brad.king@kitware.com> Fixes: #15612
* Ninja: Remove unused device link line codeBrad King2018-02-011-28/+0
| | | | | | | | Remove the `PRE_LINK` and `POST_BUILD` variables. They are not referenced by `WriteDeviceLinkRule`. Remove the `byproducts` local variable from `WriteDeviceLinkStatement` and all the code populating it. We never used the result.
* Reduce allocation of temporary values on heap.Pavel Solodovnikov2018-01-261-3/+2
| | | | | - Use `std::move` while inserting temporary results into vectors. - Change `push_back` to `emplace_back` where appropriate.
* Ninja: Fixes CUDA device link in WindowsFrancisco Facioni2018-01-151-1/+1
| | | | | | nvcc in linker mode doesn't support response files Fixes: #17644
* 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