summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* clang-tidy: Fix readability-static-accessed-through-instanceRegina Pfeifer2018-11-211-2/+2
| | | | Enable the check in .clang-tidy and fix all warnings.
* Autogen: Add cmQtAutoGenGlobalInitializer classSebastian Holtermann2018-11-111-59/+5
| | | | | This moves the global ``AUTOMOC/UIC/RCC`` targets initializer generation code into a separate new ``cmQtAutoGenGlobalInitializer`` class.
* Using front() and back() instead of calculationsCengizhan Pasaoglu2018-11-061-1/+1
|
* Merge topic 'provide_explicit_source_and_build_command_line_options'Brad King2018-09-191-2/+2
|\ | | | | | | | | | | | | | | | | 638f00117a Add release note for the -S and -B options. de962cc00d CMake: Internally uses -S instead of -H to specify source directory a10d63d578 cmake: -S and -B can be used to specify source and build directories Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2358
| * CMake: Internally uses -S instead of -H to specify source directoryRobert Maynard2018-09-151-2/+2
| |
* | Merge topic 'fix-getsafedef-stdstring'Brad King2018-09-191-4/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | 2428422c02 Fix regression in target output file naming logic d686f81e58 Restore possibly regressed CMP0018 logic Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2402
| * | Restore possibly regressed CMP0018 logicBrad King2018-09-191-4/+1
| | | | | | | | | | | | | | | | | | Refactoring in commit f4ff60a803 (cmMakefile: Make GetSafeDefinition return std::string const&, 2018-09-05) changed the treatment of the empty string in CMP0018 diagnostic logic. Restore the behavior.
* | | Merge topic 'getsafedef-stdstring'Brad King2018-09-181-5/+6
|\ \ \ | |/ / | | | | | | | | | | | | | | | f4ff60a803 cmMakefile: Make GetSafeDefinition return std::string const& Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2350
| * | cmMakefile: Make GetSafeDefinition return std::string const&Vitaly Stakhovsky2018-09-181-5/+6
| | |
* | | Merge topic 'out-of-dir-linking'Brad King2018-09-141-8/+34
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a1ad0a699b target_link_libraries: Allow use with targets in other directories 9bbae5ae28 cmTarget: Future-proof AddLinkLibrary target lookup scope f9cb6f618a cmExportFileGenerator: Use cmGeneratorTarget::ResolveTargetReference 18441a6269 cmGeneratorTarget: Factor target name resolution out of link item resolution 2f708f5d65 Make internal TARGET_PROPERTY generator expressions more robust 94a75801c8 Android.mk: De-duplicate link libraries logic during export 8a63b23d16 cmGlobalGenerator: Remove unused FindLocalGenerator method Acked-by: Kitware Robot <kwrobot@kitware.com> Reviewed-by: Patrick Stotko <stotko@cs.uni-bonn.de> Merge-request: !2370
| * | target_link_libraries: Allow use with targets in other directoriesBrad King2018-09-121-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the command did not allow naming targets on the LHS that were not created in the calling directory. Lift this restriction to enable more flexible use by projects. Targets named on the RHS will need to be looked up during generation in the scope of the call site rather than the scope of the LHS target. Introduce an internal syntax in `[INTERFACE_]LINK_LIBRARIES` properties to specify target names that need to be looked up in a directory other than that containing the target on which the property is set. Add minimal documentation of the syntax to help users that encounter it. Unfortunately CMake previously did allow such calls in the case that only `INTERFACE` libraries are specified, but those libraries would be looked up in the target's directory rather than the caller's. Add policy `CMP0079` to enable the new behavior with new lookup scope in a compatible way. Fixes: #17943
| * | Make internal TARGET_PROPERTY generator expressions more robustBrad King2018-09-121-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While collecting usage requirements from the `INTERFACE_*` properties of directly linked targets, we internally generate `TARGET_PROPERTY:` and `TARGET_OBJECTS:` generator expressions to refer to those properties on those targets. At the point we generate these expressions we already have a pointer to an exact `cmGeneratorTarget` instance. Switch from using the target name in these generator expressions to using an internal unique name generated for each `cmGeneratorTarget` instance to be referenced. This avoids depending on the user-facing target name to find the same target we already have.
| * | cmGlobalGenerator: Remove unused FindLocalGenerator methodBrad King2018-09-111-13/+0
| | | | | | | | | | | | | | | This method has not been used since commit v3.4.0-rc1~234^2~1 (cmGlobalGenerator: Port Find API to cmMakefile, 2015-08-02).
* | | cmState::GetInitializedCacheValue: Return as const std::string*Vitaly Stakhovsky2018-09-101-7/+7
|/ /
* | Merge topic 'grd-stdstring'Brad King2018-09-061-1/+1
|\ \ | | | | | | | | | | | | | | | | | | 4d89830d71 cmMakefile: Make GetRequiredDefinition return std::string Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2347
| * | cmMakefile: Make GetRequiredDefinition return std::stringVitaly Stakhovsky2018-09-051-1/+1
| |/ | | | | | | | | | | | | In all cases the return value is converted to std::string anyway. Also remove unnecessary `c_str()` calls in arguments to `GetRequiredDefinition`.
* | Remove unnecessary c_str() callsVitaly Stakhovsky2018-09-051-2/+2
|/ | | | Use the new IsOn(),IsOff() overloads.
* cmGlobalGenerator::AddInstallComponent(): Accept std::string argumentVitaly Stakhovsky2018-08-301-2/+2
|
* cmMakefile: return directories as const std::string&Vitaly Stakhovsky2018-08-271-2/+2
|
* Autogen: Use integers to store the Qt versionSebastian Holtermann2018-08-131-4/+4
|
* cmGeneratedFileStream: clang-tidy applied to remove redundant ``c_str`` callsSebastian Holtermann2018-08-071-5/+5
| | | | | | | | | | | | | | | After changing the ``cmGeneratedFileStream`` methods to accept ``std::string const&`` instead of ``const char*`` we don't need to call ``std::string::c_str`` anymore when passing a ``std::string`` to a ``cmGeneratedFileStream`` method. This patch removes all redundant ``std::string::c_str`` calls when passing a string to a ``cmGeneratedFileStream`` method. It was generated by building CMake with clang-tidy enabled using the following options: -DCMAKE_CXX_CLANG_TIDY=/usr/bin/clang-tidy-4.0;-checks=-*,readability-redundant-string-cstr;-fix;-fix-errors
* Autogen: Use a single AUTOGEN setup function in cmGlobalGeneratorSebastian Holtermann2018-08-031-24/+25
| | | | | | By moving all AUTOGEN setup code in ``cmGlobalGenerator`` into a single ``cmGlobalGenerator::QtAutoGen`` function, the ``cmGlobalGenerator::Compute`` function becomes cleaner.
* cmGlobalGenerator: Avoid -Wstringop-truncation warningBrad King2018-07-311-1/+1
| | | | | Use `memcpy` instead of `strncpy` to copy bytes into a buffer that is not intended to be null terminated.
* Autogen: Improve error detection during configurationSebastian Holtermann2018-07-111-2/+6
| | | | | | | | | | | | | | cmQtAutoGenInitializer::InitCustomTargets and cmQtAutoGenInitializer::SetupCustomTargets now return their success value which gets evaluated and passed on by the caller (cmGlobalGenerator). Checks for the existance of the moc/uic/rcc binaries have been introduces in cmQtAutoGenInitializer. Additionally they get called once with a "-h" argument to determine if they're functional. This way any binary-not-found problem is caught during the configuration phase.
* 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
|