summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.h
Commit message (Collapse)AuthorAgeFilesLines
* cmOutputConverter: Adopt relative path conversion helpersBrad King2021-05-171-13/+0
| | | | Move them up from cmLocalGenerator and out of cmStateDirectory.
* cmLocalGenerator: De-duplicate StateSnapshot memberBrad King2021-05-171-1/+0
| | | | We have the member from the cmOutputConverter parent.
* cmLocalGenerator: Remove unused MaybeRelativeToCurSrcDir methodBrad King2021-05-171-1/+0
| | | | | | | With the recent update to `GetObjectFileNameWithoutTarget`, we no longer have any call sites for `MaybeRelativeToCurSrcDir`. It does not make sense for the generator to produce paths relative to the source tree in general, so remove the method.
* cmLocalGenerator: Factor out relative path conversion helpersBrad King2021-05-131-4/+8
| | | | | | Most calls to `MaybeConvertToRelativePath` use one of our common work directories (e.g. top of the build tree) as the local path. Add helpers for each of the common cases to simplify and clarify call sites.
* cmLocalGenerator: Clarify GetIncludeFlags signatureBrad King2021-02-251-11/+19
| | | | | | | | | | | | | Make the `config` argument non-optional so all callers must be explicit. Convert the path style argument to an enumeration to make its role clear at call sites. The path style argument is implemented by `ConvertToIncludeReference`, which was introduced with the Ninja generator by commit 5b114c9bee (Introduce a cmLocalGenerator::ConvertToIncludeReference function, 2011-09-07, v2.8.7~187^2~4). Its only purpose is to allow the Ninja generator to use relative paths in `-I` flags. Add a comment explaining this role.
* cmCustomCommand: Record value of CMP0116 at time of creationKyle Edwards2021-02-231-10/+16
|
* Merge topic 'xcode12-ios_install_combined'Brad King2021-02-091-0/+2
|\ | | | | | | | | | | | | 0110aa018d IOS_INSTALL_COMBINED: Support Xcode 12 (command line only) Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5785
| * IOS_INSTALL_COMBINED: Support Xcode 12 (command line only)Craig Scott2021-02-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Xcode 12 doesn't allow nested builds within the same build directory. That means we can no longer do an install by building the install target when IOS_INSTALL_COMBINED is true. We can, however, still do an install by running the cmake_install.cmake script or executing cmake --install, since there is no outer build and therefore the associated SDK can be built as a sub-build. The non-build methods previously didn't work when IOS_INSTALL_COMBINED was true because the generated install script and the CMakeIOSInstallCombined script both made certain assumptions that relied on being part of a build. Those assumptions are now removed. A side-effect of this work is that cpack now also works from the command line when IOS_INSTALL_COMBINED is true. Relates: #21282 Fixes: #20023
* | clang-tidy: fix `readability-make-member-function-const` warningsBen Boeckel2021-01-271-1/+1
| |
* | Unity: Generate reproducible unity IDs for anonymous namespacesCraig Scott2021-01-221-0/+14
| | | | | | Fixes: #21564
* | Ninja Multi-Config: Add support for cross-config custom commandsKyle Edwards2020-12-151-1/+3
| | | | | | | | Co-Author: Brad King <brad.king@kitware.com>
* | cmLocalGenerator: Adopt custom target 'force' output name generationBrad King2020-12-151-1/+3
| |
* | cmLocalGenerator: Refactor custom command generator constructionBrad King2020-12-151-0/+4
| | | | | | | | | | | | | | Add support for constructing and using multiple generators for one custom command. cmGeneratorTarget contains a code path that needs this behavior when used with Ninja but not other generators, so use virtual dispatch through cmLocalGenerator.
* | cmMakefile: Simplify custom target 'force' output name generationBrad King2020-12-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove unnecessary check of policy CMP0049. The policy can never trigger on our internally-generated name because it has no variable references. The rename in commit 0ed5ce4cd8 (cmTarget: Rename AddSource method for backward compatibility., 2014-03-17, v3.1.0-rc1~688^2~17) made it look like this code path depended on CMP0049. Then commit 0e1faa28cb (cmMakefile: Separate custom command setup from actual creation, 2019-09-14, v3.16.0-rc1~85^2) and commit ea1bed34b2 (cmMakefile: Extract utilities used for creation of custom commands, 2019-09-21, v3.16.0-rc1~52^2~1) built additional infrastructure to thread that dependence through the call stack. Remove it all.
* | cmLocalGenerator: Evaluate generator expressions in custom command outputsBrad King2020-12-111-0/+2
| | | | | | | | | | | | | | | | | | | | | | Custom commands with generator expressions in their OUTPUTs or BYPRODUCTS are still attached to a single `.rule` file. We use an internal map to look up the source file holding the custom command for a given output. Populate this map using the outputs and byproducts from all configurations after evaluating the generator expressions for each configuration. Issue: #12877
* | cmLocalGenerator: Simplify custom command output cmSourceFile creationBrad King2020-12-101-4/+10
| | | | | | | | | | Move calls to `CreateGeneratedSource` over to `UpdateOutputToSourceMap`, which is called for all generated outputs and byproducts.
* | cmLocalGenerator: Factor out helper to expand custom command output pathsBrad King2020-12-101-0/+4
| |
* | cmLocalGenerator: Refactor UpdateOutputToSourceMap to avoid boolean trapBrad King2020-12-101-3/+9
| |
* | Refactoring: Makefiles Generators: Add support for various depends scannersMarc Chevrier2020-11-281-0/+7
| |
* | cmLocalGenerator::GetRuleLauncher: return cmPropvvs314152020-11-021-2/+1
| |
* | Constify some code as suggested by clang-tidyCengizhan Pasaoglu2020-10-191-2/+2
| |
* | cmLocalGenerator: Migrate custom command output lookup from cmMakefileBrad King2020-10-081-0/+73
|/ | | | | | | Since commit 777ceaea94 (cmMakefile: Delay custom command creation, 2019-10-17, v3.17.0-rc1~352^2) we process custom command declarations at generate time. Therefore we do not need to look up what source file holds the custom command producing a given output until generate time.
* CUDA: Clang separable compilationRaul Tambre2020-09-241-1/+1
| | | | | | | | | | | | For NVCC the compiler takes care of device linking when passed the "-dlink" flag. Clang doesn't support such magic and requires the buildsystem to do the work that NVCC does behind the scenes. The implementation is based on Bazel's device linking documentation: https://github.com/tensorflow/tensorflow/blob/7cabcdf073abad8c46e9dda62bb8fa4682d2061e/third_party/nccl/build_defs.bzl.tpl#L259 Closes: #20726
* Merge topic 'ispc_improvements'Brad King2020-09-081-0/+5
|\ | | | | | | | | | | | | | | a020787a9b ISPC: Support generation for multiple instruction sets 5a1750017e ISPC: Add compiler launcher support Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5173
| * ISPC: Support generation for multiple instruction setsRobert Maynard2020-09-041-0/+5
| |
* | Modernize: Use #pragma once in all header filesKitware Robot2020-09-031-4/+1
|/ | | | | | | | | | | | | | | | #pragma once is a widely supported compiler pragma, even though it is not part of the C++ standard. Many of the issues keeping #pragma once from being standardized (distributed filesystems, build farms, hard links, etc.) do not apply to CMake - it is easy to build CMake on a single machine. CMake also does not install any header files which can be consumed by other projects (though cmCPluginAPI.h has been deliberately omitted from this conversion in case anyone is still using it.) Finally, #pragma once has been required to build CMake since at least August 2017 (7f29bbe6 enabled server mode unconditionally, which had been using #pragma once since September 2016 (b13d3e0d)). The fact that we now require C++11 filters out old compilers, and it is unlikely that there is a compiler which supports C++11 but does not support #pragma once.
* ISPC: Support ISPC header generation byproducts and parallel buildsRobert Maynard2020-08-281-0/+1
|
* GetFeature(): return cmPropVitaly Stakhovsky2020-07-111-2/+2
|
* Refactor language standard computationJustin Goshi2020-06-161-1/+2
| | | | | Instead of mutating the configure-time cmTarget's properties at generate time, compute and store it in a cmGeneratorTarget field.
* Multi-Ninja: Fix reusable PCHs for MSVCCristian Adam2020-05-271-0/+5
| | | | Fixes: #20721
* Refactoring: Third-parties public headers are under cm3p prefixMarc Chevrier2020-05-071-1/+1
| | | | Fixes: #20666
* Merge topic 'apple-merge-same-sysroot'Brad King2020-04-221-0/+2
|\ | | | | | | | | | | | | 3a7d1e9592 Apple: Merge per-arch sysroot parameters if all are the same Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4647
| * Apple: Merge per-arch sysroot parameters if all are the sameGregor Jasny2020-04-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit a9b41195d2 (Handle multi-arch sysroots on Apple platforms, 2019-07-26, v3.17.0-rc1~287^2), CMake supports "fat" builds with different sysroots. Those are passed to the compiler with the `-Xarch_<xyz>` parameter. Unfortunately this breaks the Compiler Cache (ccache) because it does not support those compiler flags: https://github.com/ccache/ccache/blob/v3.7.9/src/ccache.c#L2700-L2705 Restore the caching ability for certain "fat" build configurations (e.g. `arm64` and `armv7`) where the sysroot is the same for all selected architectures and thus a plain `-isysroot` parameter could be used.
* | CUDA: Device linking use now link optionsMarc Chevrier2020-04-191-0/+5
| | | | | | | | | | | | | | | | | | | | properties LINK_OPTIONS and INTERFACE_LINK_OPTIONS are propagated to the device link step. To control which options are selected for normal link and device link steps, the $<DEVICE_LINK> and $<HOST_LINK> generator expressions can be used. Fixes: #18265
* | Merge topic 'msbuildUtf8Support'Brad King2020-04-151-7/+11
|\ \ | | | | | | | | | | | | | | | | | | bc877a7e94 Add support to indicate UTF-8 custom command pipe output encoding Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4587
| * | Add support to indicate UTF-8 custom command pipe output encodingJustin Goshi2020-04-131-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds a flag to indicate that pipe output from a custom command should be interpreted as UTF-8 encoded. This change does not introduce a public way to set the flag, but generators that create internally-generated commands know if they are calling cmake, which uses UTF-8 pipes. MSBuild added support for interpreting output of PreBuildEvent, PreLinkEvent, PostBuildEvent, and CustomBuildStep as UTF-8. This change will appear in Visual Studio 16.6 Preview 3. It is opt-in, and you need to add the StdOutEncoding tag. MSBuild treats these as property bags so if we emit the tag for earlier versions of Visual Studio it would be safely ignored. This change emits the StdOutEncoding tag and sets it to UTF-8 whenever the custom command UTF-8 pipe flag is set. This fixes globalization issues when the output from cmake contained characters that required MSBuild to interpret as UTF-8 before displaying them.
* | | Merge branch 'backport-3.17-apple-arch-sysroots' into apple-arch-sysrootsBrad King2020-04-081-0/+1
|\ \ \ | |/ / |/| / | |/
| * Apple: Fix mapping CMAKE_APPLE_ARCH_SYSROOTS to custom OSX_ARCHITECTURESBrad King2020-04-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `CMAKE_OSX_ARCHITECTURES` value is not used directly by generators. It is used to initialize a per-target `OSX_ARCHITECTURES` property, but that property can also be set explicitly by project code to a subset of the full list of architectures. In order to handle this case, construct a mapping from each `CMAKE_OSX_ARCHITECTURES` entry to the corresponding `CMAKE_APPLE_ARCH_SYSROOTS` entry by name. Use the mapping to find the sysroot for each entry in `OSX_ARCHITECTURES` for a given target. If `CMAKE_APPLE_ARCH_SYSROOTS` does not have the same length as `CMAKE_OSX_ARCHITECTURES`, error out early rather than risking a crash or assertion failure. Fixes: #20534
* | PCH: Add support for multi architecture iOS projectsCristian Adam2020-04-021-6/+7
|/ | | | Fixes: #20497
* Source: use std::string in place of const char*Vitaly Stakhovsky2020-01-291-14/+2
|
* Ninja: Add multi-config variantKyle Edwards2019-12-131-0/+1
| | | | Co-Authored-by: vector-of-bool <vectorofbool@gmail.com>
* cmMakefile: Delay custom command creationDaniel Eiband2019-11-241-0/+91
| | | | | | | | Move custom command creation to cmLocalGenerator and dispatch custom commands in cmMakefile to generate time. Generators add custom commands using the new methods provided by cmLocalGenerator. Issue: #12877
* cmLocalGenerator: modernize memory managementMarc Chevrier2019-11-111-5/+8
|
* PCH: Generate sources during Compute stepCristian Adam2019-10-091-2/+1
|
* file(GENERATE): Create output file structures even earlierBrad King2019-10-071-0/+1
| | | | | | | | | | | | | | Since commit b80557c7bd (file(GENERATE): Evaluate early to allow generating source files, 2014-11-04, v3.2.0-rc1~398^2) we create the `cmSourceFile` instances marked with a `GENERATED` source file property before tracing source dependencies. Move it to even earlier so that steps in `cmGlobalGenerator::AddAutomaticSources` can operate on all sources. This also avoids the accidental `O(n^2)` calls for `n` local generators that we had previously. This is also needed since commit 83c1657ff7 (Unity build: Generate sources during Compute step, 2019-10-03) to support `file(GENERATE)` outputs as sources in a target with `UNITY_BUILD` enabled.
* Unity build: Generate sources during Compute stepBrad King2019-10-031-1/+1
| | | | | | | | The unity build sources need to be added for all generators. Create them during `cmGlobalGenerator::Compute` to avoid duplicating the calls in every generator. We already handle Qt autogen there too. Issue: #19789
* Revise include order using clang-format-6.0Kitware Robot2019-10-011-1/+2
| | | | | Run the `clang-format.bash` script to update our C and C++ code to a new include order `.clang-format`. Use `clang-format` version 6.0.
* fileapi: add backtraces for LINK_PATH and LINK_DIRECTORIESJustin Goshi2019-09-181-6/+5
|
* cmLocalGenerator: Add OutputLinkLibraries overload with backtracesJustin Goshi2019-09-181-0/+5
|
* cmLocalGenerator: Add GetTargetCompileFlags overload with backtracesJustin Goshi2019-09-101-0/+3
|