summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileTargetGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* cxxmodules: rework control logic for scanning regular C++ sourcesBen Boeckel2023-10-021-8/+0
| | | | | | | | | | | Now that scanning support is no longer experimental, the logic for whether or not to scan C++ 20 sources is now important because all projects are now exposted to the logic. Make the scanning rules explicit in the documentation and rework the queries to localize all of the associated logic. A policy to handle the ultimate fallback logic will be implemented in a following commit.
* Merge topic 'modules-better-messages'Brad King2023-08-251-3/+3
|\ | | | | | | | | | | | | | | | | | | | | | | 571b5e1f2c cxxmodules: improve error messages for C++ module setup 8b4d32c18b cmStandardLevelResolver: add query for the effective standard level 17ddc4ac76 cmStandardLevelResolver: compare with static string literals 6f1dae2b01 cmStandardLevelResolver: use `cmStrCat` where possible 0d45d40e13 cmStandardLevelResolver: use character literals where possible Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !8755
| * cxxmodules: improve error messages for C++ module setupBen Boeckel2023-08-231-3/+3
| | | | | | | | | | | | | | Make it clear that: - the quoted string is a target name; and - C++ sources that export modules is the important detail.
* | LINK_OPTIONS: ensure correct dollar escapingMarc Chevrier2023-07-171-0/+6
| | | | | | | | | | | | Ensure correct escaping for Ninja and Makefile generators. Fixes: #25049
* | codecvt: Extrace codecvt::Encoding to remove codecvt includesClemens Wasser2023-06-221-4/+4
|/
* Makefiles: quote `$(COLOR)` expansionsBen Boeckel2023-06-081-1/+1
| | | | | | | | | | | | | | | | | This handles the case where `COLOR` is set to some ANSI-like color sequence in the ambient environment. These sequences tend to include `;` which terminates the command and tries to use the next component (typically an integer, possibly with a trailing `m`) with errors like: /bin/sh: line 1: 2: command not found /bin/sh: line 1: 255: command not found /bin/sh: line 1: 221: command not found /bin/sh: line 1: 255m: command not found Also add a test that sets `COLOR` in the environment which affects the generated Makefiles behavior. See: https://discourse.cmake.org/t/cmake-failing-gcc-compiler-checks/8277
* cxxmodules: remove support for `CXX_MODULE_HEADER_UNITS` filesetsBen Boeckel2023-05-311-2/+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-4/+7
| | | | | | | 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-144/+23
| | | | | | | | 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.
* Improve Const CorrectnessOrkun Tokdemir2023-05-121-37/+40
|
* CreateRulePlaceholderExpander(): enhance memory managementMarc Chevrier2023-05-041-4/+3
| | | | This method returns now a std::unique_ptr instance rather than a raw pointer.
* Link step: use linker dependency linker fileMarc Chevrier2023-05-031-2/+27
| | | | | | Based on work done by @ben.boeckel (!8051) Fixes: #22217
* CMake code rely on cmList class for CMake lists management (part. 2)Marc Chevrier2023-04-291-17/+13
|
* CMake code rely on cmList class for CMake lists management (part. 1)Marc Chevrier2023-04-241-7/+6
|
* Add generator expression support to static code analysis hooksStefan Schober2023-03-271-5/+38
| | | | | | Teach target properties `<LANG>_CPPCHECK`, `<LANG>_CPPLINT`, `<LANG>_CLANG_TIDY` and `<LANG>_INCLUDE_WHAT_YOU_USE` to accept generator expressions.
* 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
|
* Merge topic 'support_cubin_fatbin_optix_cuda_output'Brad King2023-03-141-5/+18
|\ | | | | | | | | | | | | | | 2def6a874b CUDA: Add support for CUBIN, FATBIN, and OPTIXIR compilation Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !8259
| * CUDA: Add support for CUBIN, FATBIN, and OPTIXIR compilationRobert Maynard2023-03-131-5/+18
| |
* | Makefile: Don't pass the CUDA compiler response files with UTF8_BOMRobert Maynard2023-02-281-10/+12
|/ | | | Fixes #24544
* RULE_LAUNCH_*: Add support for generator expressionsKyle Edwards2023-02-031-3/+4
|
* 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.
* | cmMakefileTargetGenerator: make "target linked info" variable Fortran-specificBen Boeckel2023-02-011-1/+1
| | | | | | | | This variable is Fortran-specific, so clarify that through its name.
* | cmMakefileTargetGenerator: simplify string streamingBen Boeckel2023-02-011-2/+2
|/
* Watcom: Fix double-quote to be single-quote in response files for wlinkJiri Malak2023-01-261-5/+10
| | | | | Response files contained double-quote for any response file, but response files for wlink must contains single-quote. This is fix for libraries list response file. Problem for object file list was fixed by MR !8115
* clang-tidy: add <LANG>_CLANG_TIDY_EXPORT_FIXES_DIR propertyKyle Edwards2022-12-061-1/+23
| | | | Fixes: #21362
* Makefiles: Name object response files with .rsp extensionFelipe Torrezan2022-11-211-0/+1
| | | | | | | This is more consistent with the Ninja generator, and is necessary for the IAR linker to recognize the argument as a response file. Fixes: #24165
* EXPORT_COMPILE_COMMANDS: add `output` fieldBen Boeckel2022-10-281-1/+1
| | | | | | | | 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`).
* COMPILER_LAUNCHER: Add support for generator expressionsThomas Weißschuh2022-08-301-2/+4
| | | | Fixes: #23441
* Merge topic 'cpp-named-module-file-sets'Brad King2022-06-171-0/+65
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 07bc3b07ec gitlab-ci: test C++ modules using GCC 1b2270aa4e ci: add a Docker image to test out C++ modules with GCC 8c5a53096a Tests/RunCMake/CXXModules: add module-using examples 4151547e2f cmGlobalNinjaGenerator: use `cmModuleMapper` implementation b43bdaff3c cmCxxModuleMapper: implement support for GCC's module map format 02d0f0e752 cmCxxModuleMapper: add source to handle module mapper contents a046a45aad cmGlobalNinjaGenerator: add a TODO for header units 386465bf83 cmTarget: add support for C++ module fileset types ... Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !7369
| * cmTarget: add support for C++ module fileset typesBen Boeckel2022-06-161-0/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
* | CUDA: Support response files with nvccRobert Maynard2022-06-131-30/+35
|/
* Provide guidance when trying to use non-enabled languageRobert Maynard2022-05-041-5/+9
| | | | Fixes #23463
* Merge topic 'nmake-rsp-encoding'Brad King2022-01-271-2/+15
|\ | | | | | | | | | | | | | | | | d5ee6d50ee NMake: Use UTF-8 BOM in response files only with MSVC tooling cab631c2e2 NMake: Document response file encoding heuristic in a comment Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !6905
| * NMake: Use UTF-8 BOM in response files only with MSVC toolingBrad King2022-01-261-0/+5
| | | | | | | | | | | | | | | | | | | | | | Since commit f3f57cc4ed (NMake: Use UTF-8 with BOM if supported by nmake, 2021-04-22, v3.21.0-rc1~217^2), we add a BOM to response files to tell MSVC tooling that they are encoded as UTF-8. However, the "NMake Makefiles" generator may also be used with non-MSVC toolchains that do not understand the BOM. Update the response file encoding selection heuristic to add the BOM only with MSVC tooling. Fixes: #23143
| * NMake: Document response file encoding heuristic in a commentBrad King2022-01-261-2/+10
| | | | | | | | | | | | | | | | Since commit f3f57cc4ed (NMake: Use UTF-8 with BOM if supported by nmake, 2021-04-22, v3.21.0-rc1~217^2) the encoding of response files is selected based on the makefile encoding. In principle these may be orthogonal, but in practice it is a useful heuristic. Call out this heuristic in a comment, and leave a FIXME to do something better.
* | Merge topic 'makefile-CMAKE_EXPORT_COMPILE_COMMANDS-HIP'Brad King2021-12-071-1/+1
|\ \ | | | | | | | | | | | | | | | | | | b59f7600c4 HIP: Enable CMAKE_EXPORT_COMPILE_COMMANDS for HIP Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6789
| * | HIP: Enable CMAKE_EXPORT_COMPILE_COMMANDS for HIPBrad King2021-12-071-1/+1
| | | | | | | | | | | | Fixes: #22986
* | | CUDA: Support CMP0105 on ClangRaul Tambre2021-11-081-0/+4
| | | | | | | | | | | | | | | | | | | | | Add link flags during the "device compile" step. Enabled the relevant tests. The disable reasons regarding separable compilation were outdated and the actual failure case was device link flags support.
* | | CUDA: Use local shorthands for variables in Clang device link codeRaul Tambre2021-11-071-14/+12
| | | | | | | | | | | | Helps reduce wrapping of lines making code more readable.
* | | Source: Replace most calls to sprintf with snprintfSean McBride2021-10-251-1/+1
| | |
* | | CUDA: Allow both CUDA_SEPARABLE_COMPILATION and CUDA_PTX_COMPILATIONRobert Maynard2021-10-201-15/+18
|/ / | | | | | | | | | | The target properties `CUDA_SEPARABLE_COMPILATION` and `CUDA_PTX_COMPILATION` now aren't mutually exclusive and can now be used together on the same target.
* | Source: Fix clang -Wimplicit-fallthrough warningsSean McBride2021-09-281-0/+1
| |
* | Rename cmProp in cmValueMarc Chevrier2021-09-211-35/+36
| |
* | IWYU: Add `--driver-mode=cl` when applicablePigeonF2021-09-101-1/+19
| | | | | | | | | | | | We already do this for `clang-tidy`. Fixes: #16554
* | Refactor: reduce cmToCStr usageMarc Chevrier2021-08-191-4/+3
| |
* | Merge branch ↵Marc Chevrier2021-08-011-2/+20
|\ \ | |/ | | | | 'backport-3.21-CC-DEPFILE-independent-from-CMAKE_DEPENDS_USE_COMPILER' into CC-DEPFILE-independent-from-CMAKE_DEPENDS_USE_COMPILER
| * add_custom_command(DEPFILE) independent from CMAKE_DEPENDS_USE_COMPILERMarc Chevrier2021-08-011-2/+20
| | | | | | | | Fixes: #22486