summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalNinjaGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Merge topic 'build-databases'Brad King2024-09-051-0/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | e77655555c cmExperimental: gate build database support behind a flag 23cbeb5035 ci: enable `build_database` CXXModules tests 6863c1d823 Tests/CXXModules: add tests for module commands 123107c1a4 Tests/CXXModules: add support for running targets under a given config 438038b5e1 Tests/CXXModules: support building specific targets of example trees 84bc710d84 cmGlobalGenerator: generate build database files for targets 670f753f24 cmDyndepCollation: write build database metadata dcf9a66ffe cxxmodules: plumb control data for exporting build databases ... Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !9708
| * cmGlobalGenerator: add a method to make an output-formatted stringBen Boeckel2024-08-271-0/+5
| | | | | | | | | | | | This is needed to inject arguments through flag generation mechanisms so that they can all be unescaped uniformly. Eventually, these methods should go away and the escape/unescape dance be avoided completely.
* | Source: Avoid comparing pointers to nullptrVitaly Stakhovsky2024-08-271-1/+1
|/
* cmSystemTools: Add GetComspec method to get cmd on WindowsAlexey Edelev2024-08-211-7/+1
| | | | | | The function attempts to read the path to cmd executable from the COMSPEC environment variable. Falls back to cmd.exe if the respective environment variable is not set or path doesn't exist.
* add_custom_command: Add CODEGEN supportJuan Ramos2024-07-011-0/+86
| | | | | | | | | | | By specifying CODEGEN as an argument to add_custom_command the custom command will be added to a codegen build target. The intent is to provide a convenient way for users to get their generated files without having to build the whole project. This can be helpful for code analysis tools which can be useful for IDEs and CI.
* cmGlobalNinjaGenerator: Reuse local generator caching of config listBrad King2024-06-211-5/+5
|
* cmGlobalNinjaGenerator: Factor out helper for global config list lookupBrad King2024-06-211-27/+20
|
* cmGlobalNinjaGenerator: De-duplicate CMAKE_CONFIGURATION_TYPES lookupBrad King2024-06-211-5/+3
|
* Merge topic 'ninja-parallel'Brad King2024-05-241-0/+15
|\ | | | | | | | | | | | | | | 0e5250e63c Ninja: Add option for parallel install daeb8fffa2 Help: Add Builtin Targets section to Ninja help Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !9505
| * Ninja: Add option for parallel installMartin Duffy2024-05-231-0/+15
| | | | | | | | | | | | | | Adds the global property ``INSTALL_PARALLEL`` to enable a parallel install target for Ninja. Fixes: #25459
* | Merge topic 'cxxmodules-gcc-binary-mode'Brad King2024-05-171-1/+4
|\ \ | |/ |/| | | | | | | | | 9e2f31ec23 cmCxxModuleMapper: add a query for the open mode for the modmap Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !9525
| * cmCxxModuleMapper: add a query for the open mode for the modmapBen Boeckel2024-05-161-1/+4
| | | | | | | | | | | | GCC (MinGW) wants to use `\n` on Windows too. Fixes: #25974
* | Merge topic 'ninja-fortran-include'Brad King2024-03-201-3/+18
|\ \ | |/ | | | | | | | | | | | | 36dc8d6d50 Ninja: Fix Fortran module deps in files INCLUDEd by preprocessed sources Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !9351
| * Ninja: Fix Fortran module deps in files INCLUDEd by preprocessed sourcesBrad King2024-03-191-3/+18
| | | | | | | | | | | | | | If a preprocessed source also uses the Fortran `INCLUDE` directive, search the original source file's directory. Fixes: #25792
| * Merge topic 'cxxmodules-dyndep-error-on-private-usage' into release-3.28Brad King2024-02-161-1/+7
| |\ | | | | | | | | | | | | | | | | | | 3f8a59a05c cxxmodules: return failure from the collator when private usage is found Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !9257
* | \ Merge topic 'cxxmodules-dyndep-error-on-private-usage'Brad King2024-02-161-1/+7
|\ \ \ | | |/ | |/| | | | | | | | | | | | | | | | 3f8a59a05c cxxmodules: return failure from the collator when private usage is found Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !9257
| * | cxxmodules: return failure from the collator when private usage is foundBen Boeckel2024-02-151-1/+7
| | |
* | | Merge topic 'cxxmodules-collation-restat'Brad King2024-02-161-0/+2
|\ \ \ | | |/ | |/| | | | | | | | | | | | | | | | | | | a7424b636b Ninja: make the collator rule use `restat = 1` e24eecfc33 Tests/CXXModules: add a test to ensure that `restat` works for collation Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !9259
| * | Ninja: make the collator rule use `restat = 1`Ben Boeckel2024-02-151-0/+2
| |/ | | | | | | This avoids rebuilds when the module metadata does not change.
* | cmNinjaTargetGenerator: use `.` for the needed phony order-only dependencyBen Boeckel2024-01-061-0/+8
| | | | | | | | It is only required for Ninja < 1.7 though.
* | Merge topic 'Ninja-LINK_OPTIONS-with-newlines'Marc Chevrier2023-12-231-0/+1
|\ \ | |/ | | | | | | | | | | | | 255c2e1430 Ninja: LINK_OPTIONS property should support newlines Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !9096
| * Ninja: LINK_OPTIONS property should support newlinesMarc Chevrier2023-12-201-0/+1
| | | | | | | | Fixes: #25513
* | Merge topic 'fortran-objects-as-sources-fix'Brad King2023-11-271-1/+58
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | beb1393f8f Merge branch 'revert-exact-collation-depends-3.27' into fortran-objects-as-sources-fix a033dce326 Makefiles: provide, but do not consume, "forward linked" target dirs 7cd0adab1b cmCommonTargetGenerator: use modules from linked object-referenced targets 1175f1c874 LinkItem: track `cmSourceFile` instances for external objects d2fa56772f Ninja: support "forwarding" modules from other targets ec1e589bec Ninja: Revert exact collation dependencies for 3.27 06df59b930 cmCommonTargetGenerator: return forward linked target dirs too f8729ab366 cmLocalUnixMakefileGenerator3: handle object-referencing Fortran modules ... Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !8989
| * Ninja: support "forwarding" modules from other targetsBen Boeckel2023-11-231-1/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | When a target uses objects from another target which provides modules as sources, the modules provided by the referenced target must also be treated as if they were provided by the referencing target. Add the concept of "forwarding" modules so that consumers can use modules created by these sources as well. Note that this is only sensible for Fortran where module usages are implicit as far as CMake's visibility model is concerned. C++ modules have their own concept of visibility which does not require or support such `$<TARGET_OBJECTS>` reuse in this way.
* | Merge topic 'Ninja-use-depslog'Brad King2023-11-071-1/+16
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bb7a0497ef cmTransformDepfile: warn when a depfile is not written to c22c473bde Tests/Ninja*/CustomCommandDepfile: check that deps are in the database b0177003e1 cmGlobalNinjaGenerator: tell `ninja` to actually read the depfile 45eff9145e cmAddCustomCommandCommand: use `cmStrCat` c6445c615b Tests/RunCMake/Ninja: fix subdir prefix check Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !8911
| * | cmGlobalNinjaGenerator: tell `ninja` to actually read the depfileBen Boeckel2023-11-011-1/+16
| | | | | | | | | | | | | | | | | | | | | But only do so if the depfile is not specified as an output of the command. Otherwise the command will out-of-date itself as `ninja` deletes depfiles that it incorporates into the database and a missing output will cause the command to run again.
* | | Merge topic 'cxxmodules-cmp0155-graceful-fallback-without-scanner'Brad King2023-11-011-2/+3
|\ \ \ | |/ / |/| / | |/ | | | | | | | | | | 1f507580a1 cmGlobalGenerator: give context about module queries 889aa0354a CMP0155: ignore scanning for sources if no scanner is available Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !8925
| * cmGlobalGenerator: give context about module queriesBen Boeckel2023-11-011-2/+3
| | | | | | | | | | | | Some queries are merely investigating support in order to change behavior. Let the method know so that any internal errors can be skipped over.
* | cmGlobalNinjaGenerator: remove unnecessary virtual methodBen Boeckel2023-10-201-7/+0
| | | | | | | | | | The implementation is the same and the called method used internally is `virtual`, so just make the call non-virtual.
* | cmGlobalNinjaGenerator: fix lambda variable name typoBen Boeckel2023-10-201-6/+6
|/
* Ninja: Allow compilation before generation of dependencies' private sourcesMartin Duffy2023-09-201-0/+14
| | | | | | | | | | This requires knowing when a generated header is public, which we can model using file sets. Add policy CMP0154 to treat generated sources as private by default in targets with file sets. Generated public headers can be specified in public file sets. Fixes: #24959 Issue: #15555
* Ninja: Use absolute path to COMSPEC if possiblescivision2023-09-111-0/+9
| | | | | | | | | If the COMSPEC is set to an absolute path, use it instead of just `cmd.exe`. This avoids searching for the tool in the current working directory and the `PATH`. If COMSPEC is not set to an absolute path, fall back to the existing behavior. Issue: #18350
* Ninja: generate scanning and build rules for C++20 module synthetic targetsBen Boeckel2023-08-171-3/+9
|
* IWYU: Update for Debian 12 CI jobBrad King2023-07-281-0/+1
| | | | | | `include-what-you-use` diagnostics, in practice, are specific to the environment's compiler and standard library. Update includes to satisfy IWYU for our CI job under Debian 12.
* LINK_OPTIONS: ensure correct dollar escapingMarc Chevrier2023-07-171-6/+6
| | | | | | Ensure correct escaping for Ninja and Makefile generators. Fixes: #25049
* Merge topic 'compile-commands-modules'Brad King2023-07-121-1/+2
|\ | | | | | | | | | | | | | | 677b28dc7b Ninja: include module mapper flags in `compile_commands.json` Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !8611
| * Ninja: include module mapper flags in `compile_commands.json`Ben Boeckel2023-07-091-1/+2
| | | | | | | | Fixes: #24618
* | codecvt: Extrace codecvt::Encoding to remove codecvt includesClemens Wasser2023-06-221-6/+6
|/
* cxxmodules: remove `CMAKE_EXPERIMENTAL_CXX_MODULE_DYNDEP` variableBen Boeckel2023-06-011-1/+0
| | | | It is now subsumed by the UUID setting completely.
* Preserve --compile-no-warning-as-error in automatic CMake re-runsBrad King2023-05-301-8/+11
| | | | | | | | When the build system re-runs `cmake` to regenerate itself, preserve the `--compile-no-warning-as-error` option if it was used when `cmake` was last explicitly invoked. Normally such settings are preserved in the cache, but the purpose of this option is to be beyond the reach of project code.
* Merge topic 'cxxmodules-private-between-targets'Brad King2023-05-191-10/+34
|\ | | | | | | | | | | | | | | | | | | | | | | d38779df2a ci: Enable RunCMake.CXXModules collation cases in clang jobs 69e4525241 Tests/CXXModules: add example for private modules between targets 18f87c87f8 cmCxxModuleMapper: track whether modules are private or not 56f7d6f827 cmCxxModuleMapper: add a structure to represent BMI locations 8207a3a266 cmDyndepCollation: add a query for visibility of an object's modules e8efcbec8c iwyu: ignore `std::remove_reference` requirements Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8476
| * cmCxxModuleMapper: track whether modules are private or notBen Boeckel2023-05-181-10/+34
| | | | | | | | | | | | | | | | | | | | This allows collation to give a useful error message when it finds usage of a private module rather than collation just not informing the compilation and the compiler erroring out about not being able to import unknown modules (which exists, but it was not told about due to visibility). Fixes: #24652
* | TargetGenerator: Factor out generation of code check rulesOrkun Tokdemir2023-05-161-1/+11
|/ | | | | | | | 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/+11
| | | | | | | 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-14/+17
| | | | | The value represents the source file to be scanned. It is not always preprocessor output.
* CMake code rely on cmList class for CMake lists management (part. 2)Marc Chevrier2023-04-291-16/+12
|
* Merge topic 'ninja-performance'Brad King2023-03-301-12/+3
|\ | | | | | | | | | | | | | | 426f3295f6 Ninja: Use more efficient data structures to collect outputs Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !8371
| * Ninja: Use more efficient data structures to collect outputsNicolas van Kempen2023-03-281-12/+3
| |
* | Merge topic 'mingw-slashes'Brad King2023-03-281-4/+6
|\ \ | |/ |/| | | | | | | | | | | a67cd9c39c Ninja: Restore slash style for MinGW tools when extra languages are enabled Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !8368
| * Ninja: Restore slash style for MinGW tools when extra languages are enabledBrad King2023-03-271-4/+6
| | | | | | | | | | | | | | | | | | | | Since commit f3ca199c9b (cmGlobalNinjaGenerator: Factor out GNU-like command-line detection on Windows, 2023-03-18, v3.26.1~2^2~6), we accidentally "unrecognize" MinGW tools on Windows if a language other than C or CXX is enabled. This causes the wrong slash style to be generated in paths in `build.ninja`. Fixes: #24642