summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.h
Commit message (Collapse)AuthorAgeFilesLines
* Revise C++ coding style using clang-format-6.0Kitware Robot2018-06-011-9/+10
| | | | | | | | | | | | Run the `clang-format.bash` script to update all our C and C++ code to a new style defined by `.clang-format`. Use `clang-format` version 6.0. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
* cmake: Add options for parallel builds to --build modeFlorian Maushart2018-05-251-5/+8
| | | | | | | While we already support `cmake --build . -- -j`, the options after `--` are specific to the native build tool. Add new options `--parallel [<N>]` and `-j [<N>]` to abstract this and map to the proper option for the native build tool.
* Make use of std::chrono throughout every componentWouter Klouwen2018-01-231-3/+4
| | | | | | | | This commit continues the changes made in CTest to support std::chrono by applying it throughout every component where a duration was used. No functional change intended.
* Autogen: Rename cmQtAutogeneratorInitializer to cmQtAutoGenInitializerSebastian Holtermann2018-01-171-2/+2
|
* Merge topic 'include_external_ms_project_support_non_windows_target'Brad King2017-12-051-0/+4
|\ | | | | | | | | | | | | | | 2c06e9e7 include_external_msproject: Support non-Windows target platforms c89e8522 cmGlobalGenerator: Add IsIncludeExternalMSProjectSupported method Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1525
| * cmGlobalGenerator: Add IsIncludeExternalMSProjectSupported methodTomoki Imai2017-12-041-0/+4
| |
* | Autogen: Make cmQtAutoGeneratorInitializer an instantiable classSebastian Holtermann2017-11-191-2/+3
|/ | | | | Remove the cmQtAutoGenDigest classes and make cmQtAutoGeneratorInitializer instantiable instead.
* CMP0037: Allow test and package targets when features are not enabledBrad King2017-10-301-0/+3
| | | | | | | When CMake will not generate a test, package, or package_source target, allow projects to create their own targets with these names. Fixes: #16062
* Merge topic 'defer-target-source-check'Brad King2017-10-251-0/+2
|\ | | | | | | | | | | | | | | 4e7f6738 Defer check for sources within a target until generation. 6e4e7c65 Tests: Exclude bad RunCMake.add_executable case on multi-arch Xcode Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1242
| * Defer check for sources within a target until generation.Deniz Bahadir2017-10-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `add_library` and `add_executable` commands can now be called with no source-files and won't generate a warning or error message, as long as source-files will be added later via the `target_sources` command. If during the generation step still no sources are associated with targets created by such calls a useful error message will be generated and generation fails. Targets of type `INTERFACE_LIBRARY`, `UTILITY` or `GLOBAL_TARGET` are excluded from this check because we do not need sources for these target types during generation. Fixes: #16872
* | Add infrastructure for generators to select a build tool instanceBrad King2017-10-191-0/+3
|/ | | | | | | | | | | | | | Add cache entry `CMAKE_GENERATOR_INSTANCE` to hold the instance location persistently across re-runs of CMake in a given build tree. For now we reject the option by default if explicitly set. It will be implemented on a per-generator basis. Pass the setting into try_compile project generation. Add a RunCMake.GeneratorInstance test to cover basic use cases for the option. Verify that `CMAKE_GENERATOR_INSTANCE` is empty by default, and that it is rejected when the generator does not support a user setting. Issue: #17268
* cmake: Add --open option for IDE generatorsGregor Jasny2017-10-131-0/+6
|
* Autogen: Iterate source files only onceSebastian Holtermann2017-09-071-1/+3
| | | | | | | | | | | | | | This is a large commit that serves multiple purposes - Iterate source files only once and store all extracted information in a cmQtAutogenDigest class that can be reused. This is brings speed improvements because several properties are only evaluated once. More that that it helps to avoid duplication of code with non trivial files property checks. - Fix the Visual Studio generator to use PRE_BUILD when possible. - Convert `for( ... )` loops to C++11 range base loops where possible (cmQtAutogen*.cxx only). - String concatenation optimizations.
* clang-format: format all code as Cpp11Daniel Pfeifer2017-08-301-3/+3
|
* IWYU: Mark cmConfigure.h with pragma: keepDaniel Pfeifer2017-08-261-1/+1
| | | | Also remove `#include "cmConfigure.h"` from most source files.
* Use C++11 nullptrDaniel Pfeifer2017-08-241-8/+8
|
* Use C++11 unordered containersDaniel Pfeifer2017-08-221-4/+5
|
* cmGlobalGenerator: Rename member to avoid shadowingBrad King2017-06-141-3/+9
| | | | | | The `CurrentMakefile` member is shadowed by a generate-time member of the same name in `cmGlobalXCodeGenerator`. Rename our member to clarify its configure-time role and avoid the shadow.
* Pass large types by const&, small types by valueDaniel Pfeifer2017-06-031-2/+4
|
* cmGlobalGenerator::DirectoryContent: remove custom copy ctorDaniel Pfeifer2017-04-211-6/+0
|
* cmGlobalGenerator: Add method to check if object file location is knownBrad King2017-04-181-0/+5
| | | | | | | Add a `HasKnownObjectFileLocation` method returning whether we know the exact location of object files produced by the native build system. This is true everywhere except on Xcode when an architecture placeholder is used.
* Use quotes for non-system includesDaniel Pfeifer2017-04-111-1/+1
| | | | | | | | | | | | | Automate with: git grep -l '#include <cm_' -- Source \ | xargs sed -i 's/#include <\(cm_.*\)>/#include "\1"/g' git grep -l '#include <cmsys/' -- Source \ | xargs sed -i 's/#include <\(cmsys\/.*\)>/#include "\1"/g' git grep -l '#include <cm[A-Z]' -- Source \ | xargs sed -i 's/#include <\(cm[A-Z].*\)>/#include "\1"/g'
* Merge topic 'ipo-policy-CMP0069'Brad King2017-03-311-0/+2
|\ | | | | | | | | | | | | | | | | | | | | | | dfa8263f Implement interprocedural optimization for GNU compilers 1588a577 Add policy CMP0069 to enforce INTERPROCEDURAL_OPTIMIZATION a7575700 Refactoring: s,GetFeatureAsBool,IsIPOEnabled, e05835c3 CheckIPOSupported: Visual Studio and Xcode generators do not support IPO Acked-by: Kitware Robot <kwrobot@kitware.com> Reviewed-by: Brad King <brad.king@kitware.com> Reviewed-by: Nils Gladitz <nilsgladitz@gmail.com> Merge-request: !568
| * Add policy CMP0069 to enforce INTERPROCEDURAL_OPTIMIZATIONRuslan Baratov2017-03-301-0/+2
| | | | | | | | | | | | | | | | | | Previously the `INTERPROCEDURAL_OPTIMIZATION` target property was honored only for the Intel compiler on Linux and otherwise ignored. In order to add support for more compilers incrementally without changing behavior in the future, add a new policy whose NEW behavior enforces the `INTERPROCEDURAL_OPTIMIZATION` property. Add flags for supported compilers and otherwise produce an error.
* | Apple: Fix Resources location for all generatorsGregor Jasny2017-03-231-0/+4
|/ | | | Issue: #16680
* Add policy CMP0068 separate install_name and RPATH settings on macOSClinton Stimpson2017-02-141-0/+3
| | | | | | | | BUILD_WITH_INSTALL_RPATH, SKIP_BUILD_RPATH, CMAKE_SKIP_RPATH and CMAKE_SKIP_INSTALL_RPATH no longer any effect on the install name of a target on macOS. Fixes: #16589
* Xcode: Control emission of EFFECTIVE_PLATFORM_NAMEGregor Jasny2017-01-201-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When building with multiple SDKs within one project Xcode requires the usage of ${EFFECTIVE_PLATFORM_NAME} to put temporary and build outout into separate directories. For example an iOS device and simulator build use two different SDKs (iphoneos and iphonesimulator). In the past cmake tries to detect embedded toolchains that could possibly use simulators and emitted EFFECTIVE_PLATFORM_NAME (EPN) at the proper locations. In #16253 Mark noticed that if he uses macosx and iphoneos in combination the necessary EPN is not emitted. This is because CMake by default assumes macosx SDK which does not trigger EPN emission. The fist naive approach - enabling EPN unconditionally revealed that then the EPN leaks into generator expressions like $<TARGET_FILE:xxx> which might be a regression and thus is unacceptable. The next approach was to add an CMake property to enable EPN emission unconditionally. This solved the reported problem. But the EPN leakage also happened for the embedded toolchains already without anyone noticing. So the control property was turned into a tri-state one: * No definition: EPN is activated for embedded toolchains like before * ON: EPN is always emitted * OFF: EPN is never emitted That approach gives the user the chance to disable EPN for embedded toolchains and restores generator expression functionality for those. Closes: #16253
* Fix several include-what-you-use findingsDaniel Pfeifer2016-11-081-11/+11
|
* Introduce CM_UNORDERED_MAPDaniel Pfeifer2016-10-241-21/+4
| | | | | Avoid duplicating switch among std::unordered_map, cmsys::hash_map, and std::map.
* cmGlobalGenerator: Allow FindMakeProgram to failBrad King2016-10-201-1/+1
| | | | | Revise its signature to return `bool` so that it can fail and abort configuration early.
* cmState: Split auxiliary classes into separate filesStephen Kelly2016-10-191-1/+2
| | | | | | | Port dependents to the new locations as needed. Leave behind a cmState.h include in cmListFileCache to reduce noise. It is removed in a following commit.
* cmState: Port dependent code to new cmStateSnapshot nameStephen Kelly2016-10-191-2/+2
|
* cmState: Port dependent code to new cmStateDirectory nameStephen Kelly2016-10-191-2/+2
|
* Factor IDE folder name retrieval out into helper methodGregor Jasny2016-10-171-1/+2
| | | | | | Add a `cmGeneratorTarget::GetEffectiveFolderName` helper to abstract lookup of the `FOLDER` property in combination with checking for generator support of folders.
* cmLinkLineComputer: Move ComputeLinkLibs from cmLocalGeneratorStephen Kelly2016-10-101-2/+3
| | | | | | | | | | | | | | | Add a cmOutputConverter to the cmLinkLineComputer and factory methods to facilitate shell escapes. Add state to the cmLinkLineComputer to record whether outputting for response files or for watcom, to satisfy the cmOutputConverter API. These are constant for the lifetime of the cmLinkLineComputer, even when its functionality is extended in the future. This also keeps the signatures of cmLinkLineComputer relatively simple. Pass the cmComputeLinkInformation as a method parameter so that cmLinkLineComputer is free from target-specific state. An instance should be usable for all targets in a directory.
* cmLinkLineComputer: Extract from cmLocalGeneratorStephen Kelly2016-10-101-0/+7
| | | | | | | | | | | CMake has several classes which have too many responsibilities. cmLocalGenerator is one of them. Start to extract the link line computation. Create generator-specific implementations of the interface to account for generator-specific behavior. Unfortunately MSVC60 has different behavior to everything else and CMake still generates makefiles for it. Isolate it with MSVC60-specific names.
* Merge topic 'nmake-encoding'Brad King2016-10-071-0/+7
|\ | | | | | | | | | | | | c666f8cb NMake: Use ANSI encoding for NMake Makefiles f00214aa cmGeneratedFileStream: Add optional encoding support bb1d3370 codecvt: Add class for encoding conversion
| * NMake: Use ANSI encoding for NMake MakefilesDāvis Mosāns2016-10-061-0/+7
| | | | | | | | | | Set ANSI encoding to cmGeneratedFileStream for use with NMake Makefile generator.
* | cmGlobalGenerator: Add API to get settings from top-level cmMakefileStephen Kelly2016-10-061-0/+4
|/ | | | | | | | | | | | | | | | | | | | | | | | | At generate-time, definitions are sometimes read from a nearby cmMakefile, making the value directory-specific because they are read once per directory. Often however, the intention is more often to create a 'global' setting, such that the user writes for example: set(CMAKE_IMPORT_LIBRARY_SUFFIX something) once at the top level of their project. Many of these are also set by internal platform files, such as CMAKE_EXTRA_LINK_EXTENSIONS. The set() definitions are not really suitable for 'global' settings because they can be different for each directory, and code consuming the settings must assume they are different for each directory, and read it freshly each time with new allocations. CMake has other variable types which are global in scope, such as global properties, and cache variables. These are less convenient to populate for users, so establish a convention and API using the value as it is at the end of the top-level CMakeLists file.
* Simplify CMake per-source license noticesBrad King2016-09-271-12/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* cmGlobalGenerator: Optimize FindMakefile method with an indexBrad King2016-09-261-0/+10
| | | | | | | This method is used by directory get/set APIs. With the new `SUBDIRECTORIES` and `BUILDSYSTEM_TARGETS` methods projects may now make heavy use of these APIs to traverse their directory structure and process targets. Make this faster by indexing the directory lookups.
* Ninja: Refactor Fortran rejection logicBrad King2016-09-221-0/+2
| | | | | | | | | Delay rejection of Fortran until after we've determined the version of the `ninja` tool to be used. This will later allow us to enable Fortran support based on the version of ninja. While at it, make the rejection an immediate fatal error. Also provide a stack trace so readers know what code tried to enable Fortran.
* cmGlobalGenerator: Refactor global target constructionBrad King2016-09-151-11/+24
| | | | | | Avoid using partially-constructed cmTarget instances. Collect the information about how to construct each target in a separate structure and then actually create each cmTarget with full construction.
* cmGlobalGenerator: Split CreateDefaultGlobalTargets implementationBrad King2016-09-151-0/+6
| | | | | Divide this long method into multiple helpers each dedicated to one of the targets. This also avoids having to clear/re-use local structures.
* fix a load of include-what-you-use violationsDaniel Pfeifer2016-09-031-15/+17
|
* make sure to include cmConfigure.h before cmStandardIncludes.hDaniel Pfeifer2016-09-031-0/+2
|
* use CM_NULLPTRDaniel Pfeifer2016-06-281-8/+8
|
* Make C++ feature checks extensibleDaniel Pfeifer2016-06-271-2/+2
| | | | | | Turn the feature check for cxx11_unordered_map into a function such that we can use it for other features as well. Drop the 11 suffix, as we may want to check features from other standards.
* cmGlobalGenerator: Make IsMultiConfig() constTobias Hunger2016-06-011-1/+1
|
* Pass arguments that are not modified as const&.Daniel Pfeifer2016-05-261-2/+2
| | | | | | | Use clang-tidy's performance-unnecessary-value-param checker to find value parameter declarations of expensive to copy types that are not modified inside the function. Ignore findings in kwsys. After applying the fix-its, manually change `const T&` to `T const&`.