summaryrefslogtreecommitdiff
path: root/Source/cmLocalGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Unity Builds: Do not set SKIP_AUTOGEN to source filesCristian Adam2020-07-291-1/+0
| | | | Fixes: #21028
* CUDA: Add issue number to Clang separable compilation errorRaul Tambre2020-06-161-1/+2
|
* CUDA: Pass toolkit path to ClangRaul Tambre2020-06-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Clang isn't very good at finding the installed CUDA toolkit. The upstream recommendation is that we should pass the toolkit explicitly. Additionally: * Avoids Clang having to search for the toolkit on every invocation. * Allows the user to use a toolkit from a non-standard location by simply setting CUDAToolkit_ROOT. The same way as with FindCUDAToolkit. Clang wants the directory containing the device library and version.txt as the toolkit path. We thus pass the newly introduced CUDAToolkit_LIBRARY_ROOT as the toolkit path. We save CUDAToolkit_ROOT_DIR and CUDAToolkit_LIBRARY_ROOT on Clang to have them available in try_compile() and avoid unnecessary re-searching or a possibly different installation being found in FindCUDAToolkit. This however means that the selected toolkit can't be changed after the initial language enablement. We now determine CUDA compiler ID before doing actual detection, as we don't want to spend time finding the CUDA toolkit for NVIDIA. Implements #20754.
* Merge topic 'cuda_clang_separable_error'Brad King2020-06-051-0/+13
|\ | | | | | | | | | | | | | | b1243201e7 CUDA: Don't RunCMake generate separable compilation tests on Clang 1b4c690543 CUDA: Throw error if CUDA_SEPARABLE_COMPILATION is ON when using Clang Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4827
| * CUDA: Throw error if CUDA_SEPARABLE_COMPILATION is ON when using ClangRaul Tambre2020-06-021-0/+13
| | | | | | | | | | Separable compilation isn't supported yet on Clang. Let's throw a helpful error instead of confusing errors during the build.
* | add_library/add_executable: allow local alias to imported targetsMarc Chevrier2020-06-021-7/+18
|/ | | | Fixes: #20641
* Merge topic 'getdef-expand'Brad King2020-06-021-5/+4
|\ | | | | | | | | | | | | 7ed8c9ebe3 cmMakefile: add GetDefExpandList() that splits value into std::vector Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4819
| * cmMakefile: add GetDefExpandList() that splits value into std::vectorVitaly Stakhovsky2020-05-301-5/+4
| | | | | | | | Combines cmMakefile:GetDefinition() and cmExpandList()
* | Single location for cmProp typedefVitaly Stakhovsky2020-06-011-0/+1
|/
* Multi-Ninja: Fix reusable PCHs for MSVCCristian Adam2020-05-271-95/+145
| | | | Fixes: #20721
* AutoMoc: Configure AutoMoc after generated sources (PCH, Unity)Cristian Adam2020-05-261-1/+7
| | | | Fixes: #20119
* Multi-Ninja: Fix PCHs for Visual C++Cristian Adam2020-05-201-1/+3
| | | | Fixes: #20711
* Merge topic 'unity_explicit_groups'Brad King2020-05-111-44/+134
|\ | | | | | | | | | | | | | | 9f4eb352fe Unity Builds: Support explicit specification of sources to groups b00585adcc Unity: Refactor implementation to make it easier to extend Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4716
| * Unity Builds: Support explicit specification of sources to groupsRobert Maynard2020-05-071-3/+64
| | | | | | | | | | Instead of having CMake determine which files should go into each unity file, the user can now use explicitly state the mapping.
| * Unity: Refactor implementation to make it easier to extendRobert Maynard2020-05-061-45/+74
| |
* | PCH: Fix REUSE_FROM in multi-config generatorsAndreas Schönle2020-05-071-1/+3
|/ | | | | | | | | Since commit a55df20499 (Multi-Ninja: Add precompile headers support, 2020-01-10, v3.17.0-rc1~136^2) the re-used PCH file object is added once for each configuration to flags used for all configurations. Put it in the flags for only the corresponding configuration instead. Fixes: #20680
* GetSafeProperty: return std::string const&Vitaly Stakhovsky2020-04-301-1/+2
|
* cmGeneratorTarget::GetProperty: return cmPropVitaly Stakhovsky2020-04-291-71/+76
|
* Merge topic 'apple-merge-same-sysroot'Brad King2020-04-221-1/+22
|\ | | | | | | | | | | | | 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-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-12/+28
| | | | | | | | | | | | | | | | | | | | 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
* | Refactoring: add cm::contains to <cmext/algorithm>Marc Chevrier2020-04-171-6/+6
| |
* | Merge topic 'cuda_architectures'Brad King2020-04-161-0/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | 21131ca60c CUDA: Add CudaOnly.CompileFlags test f0931b0790 CUDA: Convert tests to use CUDA_ARCHITECTURES e98588aaba CUDA: Add CUDA_ARCHITECTURES target property Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Patrick Stotko <stotko@cs.uni-bonn.de> Merge-request: !4568
| * | CUDA: Add CUDA_ARCHITECTURES target propertyRaul Tambre2020-04-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simplifies CUDA target architecture handling. Required for Clang support as Clang doesn't automatically select a supported architecture. We detect a supported architecture during compiler identification and set CMAKE_CUDA_ARCHITECTURES to it. Introduces CMP0104 for backwards compatibility with manually setting code generation flags with NVCC. Implements #17963.
* | | Merge topic 'cmprop-source'Brad King2020-04-151-5/+5
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | e64fa5f1b6 cmSourceFile::GetProperty: return cmProp fc223f9860 cmGlobalXCodeGenerator: Fix genex interpreter overloads Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4603
| * | | cmSourceFile::GetProperty: return cmPropVitaly Stakhovsky2020-04-141-5/+5
| |/ /
* | | Merge topic 'msbuildUtf8Support'Brad King2020-04-151-19/+24
|\ \ \ | |/ / |/| | | | | | | | | | | | | | 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-19/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | clang-tidy: address bugprone-branch-clone lintsBen Boeckel2020-04-131-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Arguably, many of these are bugs in `clang-tidy`. An if/else tree with other conditionals between cloned blocks may be relying on the intermediate logic to fall out of the case and inverting this logic may be non-trivial. See: https://bugs.llvm.org/show_bug.cgi?id=44165
* | | Merge branch 'backport-3.17-apple-arch-sysroots' into apple-arch-sysrootsBrad King2020-04-081-12/+29
|\ \ \ | |/ / |/| / | |/
| * Apple: Fix mapping CMAKE_APPLE_ARCH_SYSROOTS to custom OSX_ARCHITECTURESBrad King2020-04-081-11/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Apple: Improve handling of missing SDKs in CMAKE_APPLE_ARCH_SYSROOTSBrad King2020-04-081-1/+1
| | | | | | | | | | | | | | | | | | | | Use `<arch>-SDK-NOTFOUND` instead of an empty string as a placeholder in `CMAKE_APPLE_ARCH_SYSROOTS` for architectures whose SDK is not found. This ensures the length of `CMAKE_APPLE_ARCH_SYSROOTS` matches the length of `CMAKE_OSX_ARCHITECTURES`. It also makes the missing SDKs more visible in the value. Issue: #20534
* | Merge topic 'file-GetRuntimeDependencies_support_cross_compilation'Brad King2020-04-071-0/+65
|\ \ | | | | | | | | | | | | | | | | | | f867423aa2 file: GetRuntimeDependencies use CMAKE_OBJDUMP when applicable Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4538
| * | file: GetRuntimeDependencies use CMAKE_OBJDUMP when applicableRobert Maynard2020-04-061-0/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | On machines where the gnu bin utils are prefixed, or suffixed the file(GET_RUNTIME_DEPENDENCIES ) command would fail without explicitly setting the location of objdump. Now we pre-populate the variables used to find objdump based on the gnu bin utils, so that these use cases are better supported
* | | Merge topic 'ctest-resource-file-cache'Brad King2020-04-061-0/+6
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | 060d2ce269 CTest: Add CTEST_RESOURCE_SPEC_FILE variable Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4564
| * | | CTest: Add CTEST_RESOURCE_SPEC_FILE variableKyle Edwards2020-04-021-0/+6
| | | |
* | | | Merge topic 'pch-ios-multi-arch'Brad King2020-04-031-122/+156
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | | | | | f593b354da PCH: Add support for multi architecture iOS projects Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4561
| * | | PCH: Add support for multi architecture iOS projectsCristian Adam2020-04-021-122/+156
| |/ / | | | | | | | | | Fixes: #20497
* | | Merge topic 'cmprop-makefile'Brad King2020-04-021-9/+8
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | aba23c747b cmMakefile::GetProperty: return cmProp Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4559
| * | | cmMakefile::GetProperty: return cmPropVitaly Stakhovsky2020-04-011-9/+8
| | | |
* | | | cmLocalGenerator: Avoid using upper-case config when not necessaryBrad King2020-04-011-4/+3
| | | | | | | | | | | | | | | | | | | | Calls to `GetLinkerLanguage`, `GetSourceFiles`, etc. can accept the original-case config name.
* | | | cmLocalGenerator: Clarify local variable name in GetTargetFlagsBrad King2020-04-011-12/+13
| | | |
* | | | cmLocalGenerator: Convert GetStaticLibraryFlags to take original-case configBrad King2020-04-011-5/+6
|/ / / | | | | | | | | | Move upper-case conversion of the configuration into the implementation.
* | | Merge topic 'link-libs-config-case'Brad King2020-03-311-6/+2
|\ \ \ | |/ / |/| / | |/ | | | | | | | | | | 2af18704fd Merge branch 'backport-3.16-link-libs-config-case' 3f976bf201 target_link_libraries: Fix regression in case of $<CONFIG> genex 5a95b5e091 target_link_libraries: Fix regression in case of $<CONFIG> genex Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4544
| * target_link_libraries: Fix regression in case of $<CONFIG> genexBrad King2020-03-301-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit b8626261e9 (Precompile headers: Add methods to generate PCH sources, 2019-07-13, v3.16.0-rc1~182^2~4) we look up source files for a target using an upper-case configuration even though an original-case name is sufficient. Since commit 36ded610af (PCH: Generate sources during Compute step, 2019-10-05, v3.16.0-rc1~2^2) the source file lookup is the first time we compute many on-demand structures that depend on the configuration name. This caused the `$<CONFIG>` generator expression to evaluate to the upper-case configuration name in some cases where we used original-case before. Fix this by switching the source file lookup to the original-case config name. Add a test covering the symptom that led to the discovery of this problem. Fixes: #20517
* | cmStateDirectory::GetProperty: return cmPropVitaly Stakhovsky2020-03-271-2/+2
| |
* | Merge topic 'cleanup-endls-2'Brad King2020-03-261-26/+27
|\ \ | | | | | | | | | | | | | | | | | | 1e4b5c7d09 Refactor: Avoid `std::endl` where it's not necessary (part 2) Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4514
| * | Refactor: Avoid `std::endl` where it's not necessary (part 2)Alex Turbov2020-03-241-26/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `std::endl` manipulator, except inserting `\n` character, also performs `os.flush()`, which may lead to undesired effects (like disk I/O in the middle of forming data strings). For the `std::stringstream` it also has no meaning. * replace multiple `operator<<` calls on a string literal w/ the only call and the only (bigger) string literal; * replace one character string literal used in `operator<<` w/ a char literal.
* | | Merge topic 'compile-commands-collapse-whitespace'Brad King2020-03-261-2/+4
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | e565053bce Ninja: Remove unnecessary newlines in compile commands 5d4bab500e Avoid consecutive whitespace in rules d8622fbd0f Modules: Collapse consecutive whitespace in strings Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4512
| * | | Avoid consecutive whitespace in rulesDaan De Meyer2020-03-231-2/+4
| |/ /