summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Revise C++ coding style using clang-format-6.0Kitware Robot2018-06-011-16/+28
| | | | | | | | | | | | 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.
* Merge topic 'parallel_build_option'Brad King2018-05-291-2/+2
|\ | | | | | | | | | | | | | | 1ab3881ec9 cmake: Add options for parallel builds to --build mode Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Henry Schreiner <henryschreineriii@gmail.com> Merge-request: !1962
| * cmake: Add options for parallel builds to --build modeFlorian Maushart2018-05-251-2/+2
| | | | | | | | | | | | | | 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.
* | Revise implementation of case-insensitive command namesFlorian Jacomme2018-05-221-12/+11
|/ | | | | | | | | | | | | | | | | | | | Store both the as-written and lower-case command names and use the latter to avoid case-insensitive string comparisons. With this I obtain 2-6% speed increase (on Windows) for the configure step with no significant changes in memory usage. A case-insensitive comparison is a lot slower than just calling `==` because the operator will use things like memcmp, so prefer the latter. The `cmSystemTools::LowerCase` function allocates a new string each time it is called, so before this change we were allocating in: * cmMakefile::Configure two times for each function (to look for `cmake_minimum_required` and `project`) * cmMakefile::ExecuteCommand twice by function by calling cmState::GetCommand and copying the name Now we are only allocating once by function instead of four.
* cmMakefile: Convert private helpers to file static functionsVitaly Stakhovsky2018-05-011-30/+30
| | | | | | The two-argument forms of `AddDefineFlag` and `RemoveDefineFlag` need no access to `cmMakefile` class members. They are used only within the implementation file.
* cmMakefile: Improve ExpandVariablesInString return typeVitaly Stakhovsky2018-05-011-4/+5
| | | | | Return `std::string const&` instead of a `const char*` that points into a string anyway. Update call sites accordingly.
* Merge topic 'fix-CMAKE_DISABLE_SOURCE_CHANGES-top-dir'Brad King2018-04-251-1/+2
|\ | | | | | | | | | | | | 60cb75e4a1 Fix CMAKE_DISABLE_SOURCE_CHANGES recognition of top of build tree Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2001
| * Fix CMAKE_DISABLE_SOURCE_CHANGES recognition of top of build treeMarc Chevrier2018-04-241-1/+2
| | | | | | | | | | | | | | | | | | | | | | The change in commit v3.11.0-rc1~480^2 (UseJava: add_jar OUTPUT_DIR option used only for jar generation, 2017-10-12) added code of the form `file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR})`. This exposed an existing bug in `CMAKE_DISABLE_SOURCE_CHANGES` in which it does not recognize that the top of the build tree itself is in the build tree. Fix that now. Fixes: #17933
* | add_compile_definitions: add new commandMarc Chevrier2018-04-201-0/+5
| | | | | | | | | | | | | | This command manages preprocessor definitions at directory level and supports generator expressions. Fixes: #15374
* | cmake_policy: Add undocumented PARENT_SCOPE option to GETBrad King2018-04-181-3/+3
| | | | | | | | | | | | Policies affecting the behavior of CMake-provided macros and functions need to be able to get the policy setting as of the call site rather than the definition site. Add an undocumented option to do this.
* | Merge topic 'variable_watch-on-PARENT_SCOPE'Brad King2018-04-121-0/+9
|\ \ | | | | | | | | | | | | | | | | | | 65198cfd0f variable_watch: trigger on variables set via PARENT_SCOPE Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1948
| * | variable_watch: trigger on variables set via PARENT_SCOPEMatteo Settenvini2018-04-111-0/+9
| | | | | | | | | | | | | | | | | | | | | Make sure that we also trigger variable watches when a variable is set in the parent scope. Fixes: #17827
* | | Merge topic 'fix-crash-trace-exp-uninit-vars'Brad King2018-04-101-4/+5
|\ \ \ | |/ / |/| / | |/ | | | | | | aad360eb3d Fix crash with --trace-expand --warn-uninitialized together Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1944
| * Fix crash with --trace-expand --warn-uninitialized togetherR2RT2018-04-091-4/+5
| | | | | | | | | | | | | | | | Some code paths in `ExpandVariablesInString{New,Old}` were not checking the `filename` parameter for a null pointer, but this can happen when using the above flags together. Add the checks and a test case. Fixes: #17896
* | Sanitize paths from LINK_DIRECTORIES directory propertyjrp20142018-04-041-6/+4
| | | | | | | | | | Normally they are sanitized by the `link_directories` command before populating the property, but projects may set the property directly.
* | Features: Add infrastructure for C++ 20 language standardBrad King2018-03-271-6/+17
| | | | | | | | Issue: #17849
* | Merge topic 'policy-version-range'Craig Scott2018-03-221-3/+4
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | 45408b5ea1 cmake_minimum_required: Optionally set policies with version range 6a41aa2abd cmPolicies: Split parsing and impl of ApplyPolicyVersion 1d00ed7cf7 cmPolicies: Drop unnecessary check from ApplyPolicyVersion 0df559832b cmPolicies: Pass policy version as std::string Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1864
| * | cmake_minimum_required: Optionally set policies with version rangeBrad King2018-03-211-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | Teach `cmake_minimum_required` and `cmake_policy(VERSION)` to support a version range of the form `<min>[...<max>]`. Define this to mean that version `<min>` is required, but known policies up to those introduced by `<max>` will be set to `NEW`. This will allow projects to easily specify a range of versions for which they have been updated.
| * | cmPolicies: Pass policy version as std::stringBrad King2018-03-161-2/+2
| | |
* | | find_package: Improve CMP0074 warning messagesBrad King2018-03-211-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | Policy `CMP0074` was added by commit eb35d8884b (find_package: Use PackageName_ROOT variables as search prefixes, 2018-03-15). Revise the logic to avoid warning when a `PackageName_ROOT` variable is set to empty since that won't change the search behavior. Also, when we do warn include the variable value(s) for reference.
* | | find_package: Use PackageName_ROOT variables as search prefixesBrad King2018-03-161-0/+20
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This feature was originally added by commit v3.9.0-rc1~71^2~2 (find_*: Add a new PackageRoot search path group, 2017-05-03) and documented by commit v3.9.0-rc1~71^2 (find_*: Add docs for PackageRoot search path group, 2017-05-03). However, we had to disable the feature and remove the documentation in commit v3.9.1~2^2 (find_*: Disable the PACKAGE_ROOT search path group for CMake 3.9, 2017-08-08) due to breaking projects that used `PackageName_ROOT` variables themselves. Add policy `CMP0074` to restore the `PackageName_ROOT` variable behavior in a compatible way. Also revise the stack of root paths to store the paths themselves rather than the package names. This way the policy can be considered at the `find_package` call site instead of individual `find_` calls inside a find module. Co-Author: Chuck Atkins <chuck.atkins@kitware.com> Issue: #17144
* | Merge topic 'cmWorkingDirectory_success_checking'Brad King2018-03-091-1/+9
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | 5901699672 cmDepends: Remove attempt to change directory that always fails e60e4dfc88 cmWorkingDirectory: Check success of current dir changes e654622aee Tests: Add --build-and-test test case a865f0beb2 Tests: Confirm test working dir set successfully Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1817
| * | cmWorkingDirectory: Check success of current dir changesCraig Scott2018-03-081-1/+9
| | |
* | | cmTarget: Simplify ClearDependencyInformation signatureBrad King2018-03-061-1/+1
|/ / | | | | | | We don't need to pass an argument with the target's own name.
* | cmMakefile: Improve performance of GetSource for known filesFrank Winklmeier2018-02-231-0/+12
| | | | | | | | | | | | | | Store "Known" files separately in KnownFileSearchIndex. This avoids creating the rather expensive cmSourceFileLocation object for source files that are already known. For large projects this results in a factor 3-4 speedup of cmGlobalGenerator::Compute().
* | Tests management: add TESTS directory propertyMarc Chevrier2018-02-081-0/+14
|/ | | | Implements: #17680
* Reduce raw string pointers usage.Pavel Solodovnikov2018-01-311-15/+15
| | | | | | | | | | * 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.
* Reduce allocation of temporary values on heap.Pavel Solodovnikov2018-01-261-9/+8
| | | | | - Use `std::move` while inserting temporary results into vectors. - Change `push_back` to `emplace_back` where appropriate.
* cmMakefile: use std::string in more methods; cleanup c_str()sVitaly Stakhovsky2018-01-231-21/+22
| | | | | Follow up commit 969c1f94ae (cmSourceGroup: code improvements; use std::string and C++11 loops, 2017-01-10).
* Merge topic 'cmSourceGroup-modern-cxx'Craig Scott2018-01-171-5/+4
|\ | | | | | | | | | | | | 969c1f94 cmSourceGroup: code improvements; use std::string and C++11 loops Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1656
| * cmSourceGroup: code improvements; use std::string and C++11 loopsVitaly Stakhovsky2018-01-111-5/+4
| | | | | | | | Topic-rename: cmSourceGroup-modern-cxx
* | cmSourceFile: mark known locations as suchBen Boeckel2018-01-101-5/+9
| | | | | | | | | | | | | | | | | | | | Primarily, this includes: - the rule files generated for custom targets; - source files representing custom targets directly; - outputs of custom commands; - byproducts of custom commands; and - dependencies of custom commands.
* | cmSourceFileLocation: allow skipping ambiguous extensionsBen Boeckel2018-01-101-7/+10
|/ | | | | | | | | | | The ambiguous extension logic is an old behavior that ends up taking lots of extra compute cycles to execute. This is triggered by various CMake codepaths which pass extension-less paths down when CMake actually knows that they are not ambiguous. These codepaths will be indicated in upcoming changes. Various APIs have gained a cmSourceFileLocationKind parameter, but they are all optional and default to the existing behavior.
* Merge topic 'add_cuda_to_source_regex'Craig Scott2018-01-091-1/+1
|\ | | | | | | | | | | | | | | 81868e6b CUDA: Add cu as default source file extension Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Brad King <brad.king@kitware.com> Merge-request: !1629
| * CUDA: Add cu as default source file extensionRobert Maynard2018-01-081-1/+1
| |
* | Darwin: Emit deployment target that matches the SDKGregor Jasny2017-12-221-9/+22
| | | | | | | | Closes: #17431
* | Xcode: rename embedded SDK query functionGregor Jasny2017-12-221-1/+1
|/
* CUDA: Fix CUDA_STANDARD selection via cxx_std_11 with CXX_STANDARDRobert Maynard2017-12-151-0/+26
| | | | | | | | | | | When C++ features require a certain C++/CUDA level, verify or update the standard level target property for each language independently. While at it, add missing rejection of invalid `CUDA_STANDARD` property values. Co-Author: Brad King <brad.king@kitware.com> Fixes: #17519
* cmMakefile: Refactor determining a targets C++ standard levelRobert Maynard2017-12-151-73/+36
| | | | | | | The original code doesn't scale well as we add support for each new language level. Co-Author: Brad King <brad.king@kitware.com>
* Merge topic 'server-target-isGeneratorProvided'Brad King2017-11-271-9/+10
|\ | | | | | | | | | | | | afd9a339 server: return whether or not a target is generator provided Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1475
| * server: return whether or not a target is generator providedJustin Goshi2017-11-201-9/+10
| | | | | | | | | | | | Some generators auto-generate targets. For example VS generators create the ALL_BUILD target. Add the ability to mark targets as generator provided and return that info through cmake-server codemodel.
* | Merge topic 'serverFixTestDiscovery'Brad King2017-11-271-7/+10
|\ \ | |/ |/| | | | | | | | | fe2c2b0f server: ctestInfo fix to return all tests Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1479
| * server: ctestInfo fix to return all testsJustin Goshi2017-11-171-7/+10
| | | | | | | | | | Prior to this change we were looking at targets. But tests are associated with directories. This change fixes how we gather all tests.
* | Merge topic 'perf-source-lookup'Brad King2017-11-201-3/+18
|\ \ | | | | | | | | | | | | | | | | | | 4a6348db Performance: Improve efficiency of source file lookup in cmMakefile Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1421
| * | Performance: Improve efficiency of source file lookup in cmMakefileAaron Orenstein2017-11-171-3/+18
| |/ | | | | | | | | | | | | | | | | This reintroduces the change from commit v3.10.0-rc1~69^2 (Performance: Improve efficiency of source file lookup in cmMakefile, 2017-08-17) with some corrections. The original was rolled back by commit v3.10.0-rc1~52^2~1 (Revert "Performance: ...", 2017-09-25) due to incompatibilities found. The rollback was followed-up by addition of a test for the offending case, and this revision passes the test.
* | cmSourceGroup: Return strings from GetName and GetFullNameBrad King2017-11-151-2/+3
|/
* Merge topic 'server-test-info'Brad King2017-11-071-0/+7
|\ | | | | | | | | | | | | 35a52bd1 server: add "ctestInfo" request to get test info Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1414
| * server: add "ctestInfo" request to get test infoJustin Goshi2017-11-031-0/+7
| |
* | 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
* | Add deprecation warnings for policies CMP0054 and belowBrad King2017-11-011-1/+1
| | | | | | | | | | | | The OLD behaviors of all policies are deprecated, but only by documentation. Add an explicit deprecation diagnostic for some policies to encourage projects to port away from setting policies to OLD.