summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Revise C++ coding style using clang-format-6.0Kitware Robot2018-06-011-22/+26
| | | | | | | | | | | | 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-6/+15
| | | | | | | 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.
* OpenWatcom: Add workaround for lack of error on missing libraryBrad King2018-04-181-0/+7
| | | | | | | The OpenWatcom tools do not fail to link when a library is missing if no symbols were needed from it. This can break `try_compile` checks. Teach `cmGlobalGenerator::Build` to pretend that the build tool returned non-zero if the output contains the corresponding warning.
* cmWorkingDirectory: Check success of current dir changesCraig Scott2018-03-081-2/+12
|
* Reduce raw string pointers usage.Pavel Solodovnikov2018-01-311-10/+10
| | | | | | | | | | * Change some functions to take `std::string` instead of `const char*` in the following classes: `cmMakeFile`, `cmake`, `cmCoreTryCompile`, `cmSystemTools`, `cmState`, `cmLocalGenerator` and a few others. * Greatly reduce using of `const char*` overloads for `cmSystemTools::MakeDirectory` and `cmSystemTools::RelativePath`. * Remove many redundant `c_str()` conversions throughout the code.
* Merge topic 'reduce-temporaries'Brad King2018-01-291-50/+49
|\ | | | | | | | | | | | | c85bb007 Reduce allocation of temporary values on heap. Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1698
| * Reduce allocation of temporary values on heap.Pavel Solodovnikov2018-01-261-50/+49
| | | | | | | | | | - Use `std::move` while inserting temporary results into vectors. - Change `push_back` to `emplace_back` where appropriate.
* | Make use of std::chrono throughout every componentWouter Klouwen2018-01-231-2/+3
|/ | | | | | | | 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-5/+5
|
* Xcode: rename embedded SDK query functionGregor Jasny2017-12-221-1/+1
|
* Autogen: Make cmQtAutoGeneratorInitializer an instantiable classSebastian Holtermann2017-11-191-22/+14
| | | | | Remove the cmQtAutoGenDigest classes and make cmQtAutoGeneratorInitializer instantiable instead.
* Fix trivial typos in textluzpaz2017-11-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Some are user facing. Found using codespell -q 3 --skip="./Utilities" -I .cmake-whitelist.txt` whereby the whitelist contained: ans dum helpfull emmited emmitted buil iff isnt nto ot pathes substract te todays upto whitespaces
* CMP0037: Allow test and package targets when features are not enabledBrad King2017-10-301-5/+67
| | | | | | | When CMake will not generate a test, package, or package_source target, allow projects to create their own targets with these names. Fixes: #16062
* cmGlobalGenerator: Refactor test and package target conditionsBrad King2017-10-261-42/+50
| | | | | | In `AddGlobalTarget_{Test,Package,PackageSource}`, check conditions up front and return early if the targets are not needed. This reduces the indentation of the main logic.
* Merge topic 'cm-array-begins-size'Brad King2017-10-261-2/+2
|\ | | | | | | | | | | | | 57132765 Replace cmArray{Begin,End,Size} by their standard counterparts Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1352
| * Replace cmArray{Begin,End,Size} by their standard counterpartsMatthias Maennich2017-10-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | std::{begin,end} are part of C++11, std::{cbegin,cend} are part of C++14 and an standard compliant implementation has been introduced within the 'cm' namespace: cm::{cbegin,cend}. std::size is only part of C++17, hence exposing a compliant implementation within namespace cm (cm::size). where possible, the standard implementations are reused.
* | Merge topic 'defer-target-source-check'Brad King2017-10-251-0/+42
|\ \ | | | | | | | | | | | | | | | | | | | | | 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/+42
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+27
|/ | | | | | | | | | | | | | 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/+10
|
* Find native build tool after determining the target systemBrad King2017-09-271-9/+11
| | | | | This will allow toolchain files and platform modules to specify information that affects the selection of the native build tool.
* Meta: modernize old-fashioned loops to range-based `for`.Pavel Solodovnikov2017-09-121-188/+131
| | | | | | Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate.
* Autogen: Iterate source files only onceSebastian Holtermann2017-09-071-37/+37
| | | | | | | | | | | | | | 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.
* Use C++11 nullptrDaniel Pfeifer2017-08-241-18/+18
|
* Performance: Add an index to Change cmLocalGenerator::GeneratorTargets.Aaron Orenstein2017-08-161-4/+4
| | | | | | | | | | | Add an index to Change cmLocalGenerator::GeneratorTargets for faster lookup by name. Also changed a bunch of uses of cmLocalGenerator::GetGeneratorTargets() to take const references instead of copying the vector. Represent generator targets as a map (name -> target) to make name lookups more efficient instead of looping through the entire vector to find the desired one.
* Autogen: Merge and remove redundant function callsSebastian Holtermann2017-08-101-23/+24
|
* Add directory property 'LABELS' and CMAKE_DIRECTORY_LABELS variableBetsy McPhail2017-07-101-9/+48
| | | | | The specified LABELS will be passed down to subdirectories as well as any targets or tests in the directory.
* cmGlobalGenerator: Rename member to avoid shadowingBrad King2017-06-141-1/+1
| | | | | | 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.
* cmGlobalGenerator: Remove unused lineBrad King2017-06-121-1/+0
| | | | | | | Remove an unused line that was left by commit v2.4.0~3946 (set CMAKE_SYSTEM_VERSION for windows, 2003-07-16). Fixes: #16956
* cmGlobalGenerator: remove 'return' from void expressionDaniel Pfeifer2017-06-081-1/+1
|
* Merge topic 'lint-function-args'Brad King2017-06-051-2/+2
|\ | | | | | | | | | | | | b1ec5dea Pass large types by const&, small types by value Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !927
| * Pass large types by const&, small types by valueDaniel Pfeifer2017-06-031-2/+2
| |
* | Provide and use CM_FALLTHROUGHDaniel Pfeifer2017-06-031-0/+3
|/
* Remove second arg: npos in substr usagesPavel Solodovnikov2017-06-011-1/+1
|
* Access string npos without instancePavel Solodovnikov2017-06-011-2/+2
|
* Features: Refactor <LANG>_STANDARD updateBrad King2017-05-011-0/+12
| | | | | | | | | In order to support generator expressions in target COMPILE_FEATURES we apply them at generate time. Move this step to the beginning of generation instead of doing it on demand while collecting flags. This avoids repeating the process unnecessarily, and will then allow `cmLocalGenerator::AddCompilerRequirementFlag` to be used any time during generation.
* Merge topic 'include-style'Brad King2017-04-131-4/+4
|\ | | | | | | | | | | | | | | | | 1d829c86 Use quotes for non-system includes 26ee9e42 CPack: drop CPack prefix for includes 5afac50f cmConfigure: Ensure separate include block in headers Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !691
| * Use quotes for non-system includesDaniel Pfeifer2017-04-111-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | 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'
* | cmGlobalGenerator: Abort generation earlier on export() errorBrad King2017-04-111-4/+5
|/
* Add GENERATOR_IS_MULTI_CONFIG global propertyBastien Schatt2017-04-041-0/+1
| | | | Fixes: #16768
* Apple: Fix Resources location for all generatorsGregor Jasny2017-03-231-0/+5
| | | | Issue: #16680
* fix include order of windows.hDaniel Pfeifer2017-03-141-7/+8
| | | | | | Comments that indicate a special include order is necessary because GetCurrentDirectory might get redefined are outdated. Remove those outdated comments and use the normal ordering of includes.
* cmWorkingDirectory: use the new classBen Boeckel2017-03-061-7/+2
| | | | | | These functions just need to change the directory for a block of code and then go back to the caller's expected location. Use cmWorkingDirectory to ensure that all return paths are handled.
* Add policy CMP0068 separate install_name and RPATH settings on macOSClinton Stimpson2017-02-141-0/+25
| | | | | | | | 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-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Tolerate removed/replaced CMakeCache.txt with old CMakeFiles/Brad King2016-11-171-0/+20
| | | | | | | | | | | Users or scripts commonly remove or replace `CMakeCache.txt` without also removing `CMakeFiles/`. In this case the information saved in the cache from platform information initialization is missing, so we need to re-initialize it. In such a case, remove the platform information directory so that re-initialization will occur and restore needed information to the cache. Closes: #14820
* Merge topic 'import-librhash'Brad King2016-11-101-9/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cd8a57ae Add option to build CMake against a system librhash 71180fc8 FindLibRHash: Add module to find the librhash package 3216e94c Remove unused cm_sha2 infrastructure 5420278d Port hash computation to cmCryptoHash 9a596b33 cmCryptoHash: Re-implement in terms of librhash 47f91a61 cmCryptoHash: Avoid using subclasses at client sites d0ff3e70 librhash: Port to KWIML for ABI and integer type information 465a85fb librhash: Avoid signed left-shift overflow fc2cb74f librhash: Implement bswap_32 as a function even in strict C90 mode 0bd333bc librhash: Implement bswap_64 even in strict C90 mode 7189d62c librhash: Use __builtin_bswap{32,64} on Clang af7ebf8a librhash: Install COPYING file with CMake documentation bb01f20e librhash: Disable warnings to avoid changing 3rd party code 31bb727f librhash: Build the library within CMake 53048afa librhash: Remove source fragments not needed for CMake 5cb1b345 Merge branch 'upstream-librhash' into import-librhash ...
| * Port hash computation to cmCryptoHashBrad King2016-11-101-9/+4
| | | | | | | | | | Avoid using KWSys MD5 or `cm_sha2` and use the `cmCryptoHash` abstraction instead.
* | Fix several include-what-you-use findingsDaniel Pfeifer2016-11-081-10/+11
|/
* cmGlobalGenerator: Allow FindMakeProgram to failBrad King2016-10-201-3/+7
| | | | | Revise its signature to return `bool` so that it can fail and abort configuration early.