summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaTargetGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* cxxmodules: remove support for `CXX_MODULE_HEADER_UNITS` filesetsBen Boeckel2023-05-311-3/+1
| | | | | There's no backing implementation for header units anyways, so just remove it for now.
* TargetGenerator: Add SKIP_LINTING source propertyOrkun Tokdemir2023-05-161-7/+11
| | | | | | | The `SKIP_LINTING` source property was added to disable code check for desired source files. The `SKIP_LINTING`includes `cpplint`, `clang-tidy`, \ `cppcheck` and `include-what-you-use`. If `SKIP_LINTING` is set on a source file, the tools mentioned above will not be run on that source file.
* TargetGenerator: Factor out generation of code check rulesOrkun Tokdemir2023-05-161-173/+30
| | | | | | | | De-duplicate code check rule generation in Ninja and Makefile generators by moving their implementation to `cmCommonTargetGenerator`. Previously Ninja was generating code check rules per language. It was changed to generate code check rules for each source file.
* Ninja: Fix Fortran INCLUDE directive dependencies when not preprocessingBrad King2023-05-091-3/+12
| | | | | | | Since commit b0a6161190 (Fortran: Add Fortran_PREPROCESS property, 2020-04-24, v3.18.0-rc1~116^2~3), if `Fortran_PREPROCESS` is `OFF`, the Ninja generator does not properly detect dependencies on sources loaded via the Fortran INCLUDE directive. Fix this and add a test.
* Ninja: Rename internal Fortran scanner flag from --pp= to --src=Brad King2023-05-091-4/+4
| | | | | The value represents the source file to be scanned. It is not always preprocessor output.
* CreateRulePlaceholderExpander(): enhance memory managementMarc Chevrier2023-05-041-4/+4
| | | | This method returns now a std::unique_ptr instance rather than a raw pointer.
* CMake code rely on cmList class for CMake lists management (part. 2)Marc Chevrier2023-04-291-19/+14
|
* Ninja: Revert "Exclude NVHPC -Werror flags during Fortran preprocessing"Brad King2023-04-261-23/+2
| | | | | | | | | Revert commit 6b58cdd4cf (Ninja: Exclude NVHPC -Werror flags during Fortran preprocessing, 2023-04-04). Since commit 9d40f01442 (NVHPC: Use -Werror for COMPILE_OPTIONS_WARNING_AS_ERROR, 2023-04-13), `nvfortran` can handle the plain `-Werror` flag during preprocessing. Issue: #24665
* CMake code rely on cmList class for CMake lists management (part. 1)Marc Chevrier2023-04-241-5/+6
|
* Ninja: Exclude NVHPC -Werror flags during Fortran preprocessingBrad King2023-04-041-2/+23
| | | | | | | | The Ninja generator preprocesses Fortran separately in order to scan for module dependencies. NVHPC's `nvfortran` does not support its `-Werror` flag while preprocessing with `-E`, so filter it out. Fixes: #24665
* Add generator expression support to static code analysis hooksStefan Schober2023-03-271-2/+35
| | | | | | Teach target properties `<LANG>_CPPCHECK`, `<LANG>_CPPLINT`, `<LANG>_CLANG_TIDY` and `<LANG>_INCLUDE_WHAT_YOU_USE` to accept generator expressions.
* Merge topic 'clang-windows-cxx-modules'Brad King2023-03-211-0/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1b7c26da49 Ninja: Wrap rules using '>' shell redirection with 'cmd /C' on Windows ffd8537acf Clang: Record Clang 16.0 C++ modules flags only for GNU-like front-end 6013227230 cmGlobalNinjaGenerator: Use forward slashes in clang modmap format on Windows d9d74b5e8a cmDyndepCollation: Drop outdated mentions of CXX_MODULE_INTERNAL_PARTITIONS edab56d29a cmLocalNinjaGenerator: De-duplicate condition for using 'cmd /C' on Windows 8ebe3f92b3 cmGlobalNinjaGenerator: Detect GNU-like command-line for dyndep collator f3ca199c9b cmGlobalNinjaGenerator: Factor out GNU-like command-line detection on Windows f79817fcf0 cmCxxModuleMapper: Use value semantics in path conversion callback ... Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8346
| * cmGlobalNinjaGenerator: Detect GNU-like command-line for dyndep collatorBrad King2023-03-181-0/+4
| | | | | | | | | | This will help the collator choose flags and path styles for modmap files.
* | cmGeneratorTarget: Pass language to GetAppleArchs when possibleBrad King2023-03-151-2/+2
| |
* | cmGeneratorTarget: Convert GetAppleArchs output argument to return valueBrad King2023-03-151-4/+4
| |
* | CUDA: Add support for CUBIN, FATBIN, and OPTIXIR compilationRobert Maynard2023-03-131-10/+33
| |
* | Ninja: depend on language module information files directlyBen Boeckel2023-02-101-11/+9
| | | | | | | | | | Now that `GetLinkedTargetDirectories` can get the exact dependencies, use them to simplify the collation dependency graph.
* | Ninja: track modmap dependencies properlyBen Boeckel2023-02-101-7/+20
| | | | | | | | Mark modmaps as outputs of the collation step.
* | Ninja: remove the modmap as an output of the scannerBen Boeckel2023-02-101-11/+4
| | | | | | | | It's actually an output of the collator.
* | RULE_LAUNCH_*: Add support for generator expressionsKyle Edwards2023-02-031-3/+3
| |
* | Merge topic 'lang-linker-launcher-genex'Brad King2023-02-031-1/+2
|\ \ | |/ |/| | | | | | | | | | | | | 33e27f6ca6 <LANG>_LINKER_LAUNCHER: Allow generator expressions 84ada0b0c9 <LANG>_COMPILER_LAUNCHER: Expand subset of genexes that can be evaluated Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !8152
| * <LANG>_COMPILER_LAUNCHER: Expand subset of genexes that can be evaluatedKyle Edwards2023-02-021-1/+2
| |
* | cmCommonTargetGenerator: classify linked target directories by languageBen Boeckel2023-02-011-1/+1
|/ | | | | | | | | | | | | | | | | | | These directories are used to direct collators for Fortran and C++ modules to consume dependent module information to properly collate. However, the consumption of these files merely checks for existence of the file, not whether they are actually needed anymore. The problem arises when a target has Fortran or C++ modules at point A, a build occurs populating this file, and then the target is updated to no longer have potential modules. The `DependInfo.make` (for `Makefiles`) or `<LANG>DependInfo.json` (for `Ninja`) files still exist as they are never guaranteed to be cleaned up. This can introduce stale information to the build which may cause a false-positive compilation if a module file happens to still exist and gets found this way. Instead, query the `linked-target-dirs` using the language in question and only add the directory if it contains potential sources for modules coming from the language in question.
* cxxmodules: support new round of Clang patchesBen Boeckel2022-12-151-3/+0
| | | | | | | | | | These patches now support the `-MF` output, so remove the `none` support added just for the old patchset which did not use it. Also update the flag name to `-fmodule-output=`. Due to the new Clang module mapper flag, use a new experimental support UUID as well.
* Merge topic 'clang-tidy-export-fixes-dir'Brad King2022-12-071-1/+48
|\ | | | | | | | | | | | | | | 232467eb1c clang-tidy: add <LANG>_CLANG_TIDY_EXPORT_FIXES_DIR property Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !7982
| * clang-tidy: add <LANG>_CLANG_TIDY_EXPORT_FIXES_DIR propertyKyle Edwards2022-12-061-1/+48
| | | | | | | | Fixes: #21362
* | cmNinjaTargetGenerator: skip setting `depfile` for `none` scantypesBen Boeckel2022-12-021-0/+3
| | | | | | | | | | The `clang` mechanism does not support `depfile` discovered dependencies at the moment.
* | cmNinjaTargetGenerator: use `.clear()` to empty out some stringsBen Boeckel2022-12-021-2/+2
|/
* cmDyndepCollation: factor out writing C++ module info from NinjaBen Boeckel2022-11-301-214/+10
| | | | | | | | | To facilitate other generators being able to build C++20 modules, start pulling out collator logic into a generator-agnostic location. This commit starts by factoring out the information written to the "target depend info" object consumed during the build to handle writing out export and installation scripts expected during those steps.
* cmGeneratorTarget: factor out fileset info and scanning detectionBen Boeckel2022-11-231-86/+3
|
* cmGeneratorTarget: factor out dyndep support detectionBen Boeckel2022-11-231-19/+2
|
* cxxmodules: add properties to control scanningBen Boeckel2022-11-181-8/+48
| | | | | | The `CXX_SCAN_FOR_MODULES` property may be used to control scanning for targets and for source files rather than assuming "C++20 always needs to be scanned".
* cmNinjaTargetGenerator: factor out determining the fileset of a sourceBen Boeckel2022-11-171-47/+68
| | | | | This information is now needed in more than one place, so factor the logic out and use it to build a cache.
* Merge topic 'compile-commands-output-field'Brad King2022-11-011-1/+2
|\ | | | | | | | | | | | | | | 887a8874c3 EXPORT_COMPILE_COMMANDS: add `output` field Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !7844
| * EXPORT_COMPILE_COMMANDS: add `output` fieldBen Boeckel2022-10-281-1/+2
| | | | | | | | | | | | | | | | Also write for all configurations from multi-config generators. This field was added in the Clang 5 documentation and not present in the Clang 4 documentation (sometime between Dec 2016 and Mar 2017 according to `web.archive.org`).
* | Swift: Omit output-file-map when used as a linkerEvan Wilde2022-10-281-21/+33
|/ | | | | | | | | | | | | | | Swift is used as the linker for non-swift files because it needs to pull files like swiftrt.o in when swift symbols are present to ensure that the swift runtime is linked. The swift driver uses clang as the underlying linker, which pulls in crtbegin.o and friends when appropriate, so using Swift as a linker for C/C++ libraries is fine. The output-file-map was getting passed to all Swift invocations, regardless of whether or not we generated one. This patch changes it so that we only include the output-file-map in the Swift compiler invocation if we have actually generated the file.
* COMPILER_LAUNCHER: Add support for generator expressionsThomas Weißschuh2022-08-301-2/+4
| | | | Fixes: #23441
* Ninja Multi-Config: Deduplicate compile_commands.json for cross configsKyle Edwards2022-07-151-3/+5
| | | | | | | | compile_commands.json was being written for every permutation of cross configurations. Deduplicate so only one command is output for each configuration. Fixes: #23733
* cmNinjaTargetGenerator: write out BMI install information for the collatorBen Boeckel2022-07-061-0/+38
|
* cmNinjaTargetGenerator: write out export information for the collatorBen Boeckel2022-07-061-0/+79
| | | | | The collator will use this to know where the target's export information needs to go so that module properties may be provided.
* cmNinjaTargetGenerator: write out fileset information for the collatorBen Boeckel2022-07-061-0/+99
| | | | | The collator will use this to generate property settings for the imported targets in the build and install export sets.
* cmTarget: add support for C++ module fileset typesBen Boeckel2022-06-161-47/+45
| | | | | | | | | | | | | | | C++ modules have two variants which are of importance to CMake: - `CXX_MODULES`: interface modules (those using `export module M;`, `export module M:part;`, or `module M:internal_part;`) - `CXX_MODULE_HEADER_UNITS`: importable header units Creating C++ modules or partitions are *not* supported in any other source listing. This is because the source files must be installed (so their scope matters), but not part of usage requirements (what it means for a module source to be injected into a consumer is not clear at this moment). Due to the way `FILE_SET` works with scopes, they are a perfect fit as long as `INTERFACE` is not allowed (which it is not).
* cmNinjaTargetGenerator: expand CFGIntDir for NMCBen Boeckel2022-06-141-2/+3
|
* cmNinjaTargetGenerator: support msvc-style deps discovery for scanningBen Boeckel2022-04-271-10/+21
|
* cmNinjaTargetGenerator: add flags for scanning based on the fileset typeBen Boeckel2022-04-271-0/+52
|
* CUDA: Ninja generator generates valid compile databaseRobert Maynard2022-03-301-15/+19
| | | | | | | The ninja generator has been updated to poperly write the compile database when the CUDA language has been enabled. Fixes #23368
* Ninja: Avoid preprocessing twice with explicit Fortran_PREPROCESSPeter Hill2022-02-241-1/+2
| | | | | | Fix spurious warnings from gfortran+Ninja for preprocessing. Fixes: #23248
* cmLocalGenerator: Remove unused IncludePathStyle infrastructureBrad King2021-12-011-8/+3
| | | | | | It is unused since commit c564a3e3ff (Ninja: Always compile sources using absolute paths, 2021-05-19, v3.21.0-rc1~129^2), which left behind a FIXME comment to eventually remove it.
* Merge topic 'ninja-pdb-dir'Brad King2021-11-041-1/+1
|\ | | | | | | | | | | | | | | 73b84db62d Ninja: Fix creation of Windows import library directory bd36735f65 cmNinjaTargetGenerator: Replace "their" with "there" in comment Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6694
| * cmNinjaTargetGenerator: Replace "their" with "there" in commentBrad King2021-11-031-1/+1
| |