summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* LINKER_TYPE: Support MOLD only on GCC versions that support itMarc Chevrier2024-03-131-4/+17
| | | | Fixes: #25748
* LINKER_TYPE: fix spelling error in messageMarc Chevrier2024-03-121-1/+1
|
* Merge topic 'restore-link-interface-objlib-with-unity' into release-3.29Brad King2024-02-221-5/+0
|\ | | | | | | | | | | | | | | | | 5b8e9e068f Restore support for TARGET_OBJECTS in link interfaces with unity builds 1313c78a9c Tests: Update RunCMake.TargetObjects cmake_minimum_required version Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !9279
| * Restore support for TARGET_OBJECTS in link interfaces with unity buildsBrad King2024-02-211-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | This was broken by commit df08c37a42 (cmGlobalGenerator: Add unity/pch sources after computing compile features, 2024-02-02, v3.28.3~1^2~1^2), and 3.28.2's commit 76b5383123 (cmGlobalGenerator: add unity sources after computing target compile features, 2024-01-01, v3.28.2~17^2~1). The problem is very similar to that fixed by commit 4e8f24e977 (PCH: Clear link interface cache when adding PCH object to it, 2022-01-24, v3.23.0-rc1~44^2~9). Generalize that fix. Fixes: #25696
* | Merge branch 'backport-3.28-visionOS' into visionOSBrad King2024-02-091-8/+43
|\ \ | |/
| * visionOS: Update deployment-target flag for Xcode 15.1 betaBrad King2024-02-091-3/+36
| | | | | | | | | | | | | | | | Use the same flags Xcode adds for `XROS_DEPLOYMENT_TARGET`. They are `-target arm64-apple-xros1.0` and `-target arm64-apple-xros1.0-simulator`, where `1.0` is the deployment target version. Fixes: #25188
| * cmLocalGenerator: Avoid unnecessary lookup without a deployment targetBrad King2024-02-091-8/+10
| |
* | Merge topic 'restore-pch-with-unity'Brad King2024-02-051-0/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | 30829da506 Unity: Clarify source comments on unity build transformation 87bf1c6c33 Merge branch 'unity-after-compile-features' into restore-pch-with-unity df08c37a42 cmGlobalGenerator: Add unity/pch sources after computing compile features 004c3c3986 Tests: Add case covering PCH in a unity build Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Acked-by: Ben Boeckel <ben.boeckel@kitware.com> Merge-request: !9215
| * Unity: Clarify source comments on unity build transformationBrad King2024-02-021-0/+1
| |
* | Merge topic 'cxxmodules-no-unity'Brad King2024-01-101-0/+9
|\ \ | |/ | | | | | | | | | | | | | | | | 63bbb3768d cmLocalGenerator: ignore scanned sources for unity builds 76b5383123 cmGlobalGenerator: add unity sources after computing target compile features 7fc2a83fe6 Tests/CXXModules: add a test with unity build support Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !9118
| * cmLocalGenerator: ignore scanned sources for unity buildsBen Boeckel2024-01-051-0/+9
| |
* | Merge topic 'swift-split-compilation-model'Brad King2023-12-161-1/+7
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | 9bed4f4d81 Swift/Ninja: Split compilation model 64b3367845 cmGlobalGenerator: Allow passing language to GetLangaugeOutputExtension Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !8907
| * | Swift/Ninja: Split compilation modelEvan Wilde2023-12-151-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Splitting the Swift build into an object build and a separate link step, instead of building and linking in one step. The immediate benefit is LSP support because we are able to emit compile-commands for Swift files now. Additionally, it is possible to specify flags to the compile step, enabling folks to emit C and C++ headers from their Swift builds for C/C++ interop, without needing custom commands. Eventually, this gives us a path toward working object libraries. Object Libraries: - Object libraries don't work today because CMake doesn't emit targets for object libraries into the Ninja build file. - tl;dr: Object libraries work if they aren't WMO. Still need work to make WMO'd object libraries work. Object libraries still don't completely work with this patch because, while we emit the targets, the `TARGET_OBJECTS` generator expression expansion has a separate mechanism for determining what the names of the objects are based on the input source files, so targets that depend on an object library built with a whole-module optimization will depend on objects based on the name of the source file instead of the actual emitted object file. These features require being able to accurately model wholemodule builds though, because we actually need to track object files and WMO affects what objects are emitted. For that, we require CMP0157 use the NEW policy. When it's OLD, we have to fall back on the old behavior and cannot provide object libraries or the compile-commands for LSP. Issue: #25308
* | | Merge topic 'cmake-sources-no-scan'Brad King2023-12-121-0/+2
|\ \ \ | | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | 91b7bf59a7 cmGlobalXCodeGenerator: disable C++ module scanning for force-lang files 9e19a61ddb cmLocalGenerator: disable C++ module scanning for unity sources fa9a72a788 cmLocalGenerator: disable C++ module scanning for copied PCH sources e5dce1a37e cmQtAutoGenInitializer: disable C++ module scanning for autogen sources 4fd596c34c cmGeneratorTarget: disable C++ module scanning for verify targets Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !9064
| * | cmLocalGenerator: disable C++ module scanning for unity sourcesBen Boeckel2023-12-111-0/+1
| | |
| * | cmLocalGenerator: disable C++ module scanning for copied PCH sourcesBen Boeckel2023-12-111-0/+1
| | |
* | | Merge topic 'cxxmodules-pch'Brad King2023-12-051-0/+3
|\ \ \ | |/ / | | / | |/ |/| | | | | | | | | | | 40dc13b242 cmNinjaTargetGenerator: PCH files do not need dyndep f61c64cd1c cmLocalGenerator: prevent scanning of PCH source files ea8c37b759 Tests/CXXModules: add a test which scans a PCH-using source Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !9032
| * cmLocalGenerator: prevent scanning of PCH source filesBen Boeckel2023-12-041-0/+3
| |
* | Swift: Add abstraction for compilation modeEvan Wilde2023-11-171-0/+61
| | | | | | | | | | | | | | | | | | | | | | Add a `CMAKE_Swift_COMPILATION_MODE` variable and corresponding `Swift_COMPILATION_MODE` target property to control the compilation mode. Select among `wholemodule`, `singlefile`, and `incremental`. Add policy CMP0157 to remove the default `-wmo` flags in favor of the abstract setting. Issue: #25366
* | Unity: Enable UNITY_BUILD for OBJC and OBJCXX filesRob Raguet-Schofield2023-10-261-3/+12
| |
* | Add options to specify linker toolMarc Chevrier2023-10-131-1/+44
|/ | | | | | | | | | | | | | | | | | Offer the capability, through variable `CMAKE_LINKER_TYPE`, as well as the target property `LINKER_TYPE` to specify which linker must be used. The implementation of this capability is specified by variables specific to the language and linker type: `CMAKE_<LANG>_USING_LINKER_<TYPE>`. Some definitions are provided as part of `CMake`. For example, to select the `LLVM` linker rather than the standard one, the type `LLD` should be specified through the variable `CMAKE_LINKER_TYPE`. And, on `Apple`, `Linux` and some environments on `Windows`, the variable `CMAKE_<LANG>_USING_LINKER_LLD` has value `-fuse-ld=lld`. And for `Windows` environments based on `MSVC`, where the linker is used directly, the tool `lld-link.exe` will be used rather than `link.exe`. Fixes: #19174, #24254, #24990
* Merge topic 'hip-nvidia'Brad King2023-09-221-1/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | 6546aa2a2a ci: Add HIP job using CUDA on NVIDIA GPUs 18158bf81c HIP: Add support for NVIDIA GPUs 127b6fa06b HIP: Add CMAKE_HIP_PLATFORM variable to specify GPU platform 90e23f40ee Tests/HIP/WithDefs: Clean up test case 9ebdf3281f Tests/HIP/ArchitectureOff: Cover HIP_ARCHITECTURES initialization cfec29196e ci: Add CUDA 11.8 to HIP 5.5 image 26470eb987 ci: Put HIP GPU platform in CMake_TEST_HIP Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8817
| * HIP: Add support for NVIDIA GPUsBrad King2023-09-211-1/+3
| | | | | | | | | | | | Add support for using the CUDA Toolkit's NVCC to compile HIP code. Fixes: #25143
* | macOS: GNU toolchain: ensure framework, marked as SYSTEM, can be linkedMarc Chevrier2023-09-211-4/+1
|/ | | | Fixes: #25263
* PCH: Add missing dependency of REUSE_FROM shared compiler PDBRussell Greene2023-09-111-5/+6
| | | | | | | Have the `copy_pdb_idb` script depend on the PCH file so that the shared compiler PDB is updated when the PCH is rebuilt. Fixes: #25240
* Merge topic 'unity_c_no_extensions'Brad King2023-08-161-1/+1
|\ | | | | | | | | | | | | | | 7f7c443667 Unity: use C-style comments to work both with C and C++ Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !8718
| * Unity: use C-style comments to work both with C and C++Sylvain Joubert2023-08-151-1/+1
| | | | | | | | | | | | | | | | Update the comment added by commit 485256f2d0 (Unity: Suppress clang-tidy 'bugprone-suspicious-include' warning, 2023-04-27, v3.27.0-rc1~149^2) to work for C. Fixes: #25184
* | cmLocalGenerator: always support shortening filenamesBen Boeckel2023-08-081-13/+5
| |
* | cmCryptoHash: prefer to cmSystemTools::ComputeStringMD5Ben Boeckel2023-08-081-4/+2
| | | | | | | | | | | | | | The latter call is no longer post-bootstrap only since 596439b1bb (cmCustomCommandGenerator: Add option to transform depfile, 2020-10-05) via !5325. Convert callers to just use `cmCryptoHash` directly and remove the bootstrap guard.
* | Merge topic 'doc-fixups-release-3.27'Craig Scott2023-08-071-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | 78e7ea598d cmLocalGenerator: Fix trivial spelling error in code comment 1285fe27ff Help: Improve formatting and fix wording for ENABLE_EXPORTS 91336d061c Help: Improve formatting and cross-references for DEPENDS_EXPLICIT_ONLY 03208d9e18 Help: Fix indenting within TARGET_RUNTIME_DLLS genex docs Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8688
| * cmLocalGenerator: Fix trivial spelling error in code commentCraig Scott2023-08-061-1/+1
| |
* | IWYU: Update for Debian 12 CI jobBrad King2023-07-281-0/+2
| | | | | | | | | | | | `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.
* | macOS: Add support for linking against .xcframework foldersKyle Edwards2023-07-261-0/+39
| | | | | | | | Issue: #21752
* | LINK_OPTIONS: ensure correct dollar escapingMarc Chevrier2023-07-171-0/+11
|/ | | | | | Ensure correct escaping for Ninja and Makefile generators. Fixes: #25049
* HIP: Fix implicit include directory detection under /usr/includeCordell Bloor2023-06-021-0/+11
| | | | | | | | | | | | The `CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES` are computed using `try_compile` in `CMAKE_DETERMINE_COMPILER_ABI`, but the implicit include directories are not known during that `try_compile`. This can be a problem when the HIP runtime include path is `/usr/include`, because the runtime include path is always added to the userDirs and the compiler automatically includes standard library headers via `__clang_hip_runtime_wrapper.h`. Issue: #24562
* Apple Frameworks: honor SYSTEM target propertyMarc Chevrier2023-05-111-18/+22
| | | | Fixes: #24109
* CreateRulePlaceholderExpander(): enhance memory managementMarc Chevrier2023-05-041-7/+6
| | | | This method returns now a std::unique_ptr instance rather than a raw pointer.
* Link step: use linker dependency linker fileMarc Chevrier2023-05-031-0/+38
| | | | | | 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-23/+18
|
* Unity: Suppress clang-tidy 'bugprone-suspicious-include' warningSylvain Joubert2023-04-271-0/+1
| | | | | | Unity builds intentionally include entire source files. Fixes: #24857
* CMake code rely on cmList class for CMake lists management (part. 1)Marc Chevrier2023-04-241-13/+14
|
* cmGeneratorTarget: Pass language to GetAppleArchs when possibleBrad King2023-03-151-2/+2
|
* cmGeneratorTarget: Convert GetAppleArchs output argument to return valueBrad King2023-03-151-3/+2
|
* Apple: Handle generation and comsuption of text-based stubs (.tbd files)Marc Chevrier2023-03-011-0/+8
| | | | Fixes: #24123
* Enhance support functionsMarc Chevrier2023-02-281-4/+4
| | | | | * Avoid duplicate definiitions for IsExecutableWithExports, etc... * Add helper IsApple()
* Merge topic 'avoid-cmake-cfg-intdir'Brad King2023-02-071-4/+9
|\ | | | | | | | | | | | | | | | | | | | | | | 2b17b6da6a cmGlobalGenerator: Avoid referencing CMAKE_CFG_INTDIR f34876561f Tests: Remove or silence instances of ${CMAKE_CFG_INTDIR} 78cf427157 RULE_LAUNCH_*: Add support for generator expressions cabad8a37f ExternalProject: Always use $<CONFIG> for source files 62e8884d3f CTestTargets: Use $<CONFIG> instead of ${CMAKE_CFG_INTDIR} Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !8169
| * RULE_LAUNCH_*: Add support for generator expressionsKyle Edwards2023-02-031-4/+9
| |
* | cmCustomCommand: Refactor custom command-specific policy valuesKyle Edwards2023-02-061-1/+0
|/ | | | | | | | | | | | | | | | | Many custom commands are created by CMake itself rather than by the user. These custom commands should always have their policies set to NEW, and user-created custom commands should have their policy values set only from the state snapshot. In addition, we want to genericize the mechanism of recording a policy at the time of custom command creation. Add a CM_FOR_EACH_CUSTOM_COMMAND_POLICY macro to genericize custom command policies. Use this to define all custom command policies. Make all such policies NEW instead of WARN by default. Remove individual policy modifier methods and add a single method that records relevant values from a cmStateSnapshot. Remove the no longer needed explicit policy settings from synthesized custom commands.
* Merge topic 'add_visbility_flags_to_device_link_line'Brad King2023-01-181-1/+1
|\ | | | | | | | | | | | | 0c56bdf91e CUDA: device linking obeys CMAKE_CUDA_VISIBILITY_PRESET setting Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8065
| * CUDA: device linking obeys CMAKE_CUDA_VISIBILITY_PRESET settingRobert Maynard2023-01-161-1/+1
| | | | | | | | Fixes #24272