summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* PCH: Generate sources during Compute stepCristian Adam2019-10-091-0/+1
|
* file(GENERATE): Create output file structures even earlierBrad King2019-10-071-8/+1
| | | | | | | | | | | | | | Since commit b80557c7bd (file(GENERATE): Evaluate early to allow generating source files, 2014-11-04, v3.2.0-rc1~398^2) we create the `cmSourceFile` instances marked with a `GENERATED` source file property before tracing source dependencies. Move it to even earlier so that steps in `cmGlobalGenerator::AddAutomaticSources` can operate on all sources. This also avoids the accidental `O(n^2)` calls for `n` local generators that we had previously. This is also needed since commit 83c1657ff7 (Unity build: Generate sources during Compute step, 2019-10-03) to support `file(GENERATE)` outputs as sources in a target with `UNITY_BUILD` enabled.
* Unity build: Generate sources during Compute stepBrad King2019-10-031-0/+18
| | | | | | | | The unity build sources need to be added for all generators. Create them during `cmGlobalGenerator::Compute` to avoid duplicating the calls in every generator. We already handle Qt autogen there too. Issue: #19789
* Merge topic 'clang-format-normalize-headers-presentation'Brad King2019-10-021-4/+6
|\ | | | | | | | | | | | | | | | | | | ed98209ddc Revise include order using clang-format-6.0 185fe49f29 clang-format: Normalize headers presentation 42ef28b4f3 Remove unused uid_t/gid_t types on Windows Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Sebastian Holtermann <sebholt@web.de> Merge-request: !3851
| * Revise include order using clang-format-6.0Kitware Robot2019-10-011-4/+6
| | | | | | | | | | Run the `clang-format.bash` script to update our C and C++ code to a new include order `.clang-format`. Use `clang-format` version 6.0.
* | PCH: Report error when setting COMPILE_PDB_NAME propertyCristian Adam2019-10-011-0/+40
|/ | | | | Reusable precompile headers require specific COMPILE_PDB_NAME property values. Report error if the user tries to set a different value.
* Merge branch 'backport-3.15-fix-EXCLUDE_FROM_ALL-subdir-all'Brad King2019-09-301-3/+11
|\ | | | | | | | | | | | | | | Resolve conflicts with changes since the 3.15 series: * Convert `cmSystemTools::IsOn` => `cmIsOn`. * Move one "EXCLUDE_FROM_ALL" target property logic fix to its new location in `cmMakefile::AddNewUtilityTarget`.
| * Merge branch 'backport-3.14-fix-EXCLUDE_FROM_ALL-subdir-all'Brad King2019-09-301-3/+11
| |\
| | * Restore "all" target in subdirectories marked EXCLUDE_FROM_ALLBrad King2019-09-301-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "all" target in each directory is supposed to have targets from that directory even if the directory itself is marked `EXCLUDE_FROM_ALL` in its parent. This was broken by commit dc6888573d (Pass EXCLUDE_FROM_ALL from directory to targets, 2019-01-15, v3.14.0-rc1~83^2) which made the participation of a target in "all" independent of context. Revert much of the logic change from that commit to restore the old behavior. Then re-implement the behavior intended by the commit to keep its test working. Extend the test to cover the old behavior too. Fixes: #19753
* | | cmCustomCommand: Move custom commandsDaniel Eiband2019-09-261-1/+1
| | |
* | | clang-tidy: modernize-deprecated-headersRegina Pfeifer2019-09-161-3/+3
| | |
* | | Merge topic 'add-non-empty-configurations-getter'Brad King2019-09-031-11/+4
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | 10507c6dc0 cmMakefile: Add configurations getter with empty configuration default Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3759
| * | | cmMakefile: Add configurations getter with empty configuration defaultDaniel Eiband2019-08-301-11/+4
| | | |
* | | | cmSourceFile: Rename mutating GetFullPath() overloadDaniel Eiband2019-08-291-1/+1
|/ / / | | | | | | | | | Rename mutating GetFullPath() overload to ResolveFullPath().
* | | Merge topic 'cmGlobalGenerator-compilerId-lifetime'Brad King2019-08-271-7/+4
|\ \ \ | |/ / | | | | | | | | | | | | | | | 17ce0c29ad cmGlobalGenerator: Fix CheckCompilerIdCompatibility local var lifetime Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3741
| * | cmGlobalGenerator: Fix CheckCompilerIdCompatibility local var lifetimeBrad King2019-08-261-7/+4
| | | | | | | | | | | | | | | | | | Save the value of the compiler id variable in storage we own so that mutating it based on a policy does not invalidate the local value for later comparisons. This was identified by Clang AddressSanitizer.
* | | Source sweep: Replace cmExpandList with the shorter cmExpandedListSebastian Holtermann2019-08-231-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces the code pattern ``` std::vector<std::string> args; cmExpandList(valueStr, args, ...) ``` with ``` std::vector<std::string> args = cmExpandedList(valueStr, ...) ```
* | | Source sweep: Use cmStrCat for string concatenationSebastian Holtermann2019-08-221-101/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is generated by a python script that uses regular expressions to search for string concatenation patterns of the kind ``` std::string str = <ARG0>; str += <ARG1>; str += <ARG2>; ... ``` and replaces them with a single `cmStrCat` call ``` std::string str = cmStrCat(<ARG0>, <ARG1>, <ARG2>, ...); ``` If any `<ARGX>` is itself a concatenated string of the kind ``` a + b + c + ...; ``` then `<ARGX>` is split into multiple arguments for the `cmStrCat` call. If there's a sequence of literals in the `<ARGX>`, then all literals in the sequence are concatenated and merged into a single literal argument for the `cmStrCat` call. Single character strings are converted to single char arguments for the `cmStrCat` call. `std::to_string(...)` wrappings are removed from `cmStrCat` arguments, because it supports numeric types as well as string types. `arg.substr(x)` arguments to `cmStrCat` are replaced with `cm::string_view(arg).substr(x)`
* | | Merge topic 'cm-contains'Brad King2019-08-211-8/+5
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2dfc52675c cmAlgorithms: Add cmContains Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Sebastian Holtermann <sebholt@web.de> Acked-by: Daniel Pfeifer <daniel@pfeifer-mail.de> Merge-request: !3700
| * | | cmAlgorithms: Add cmContainsRegina Pfeifer2019-08-191-8/+5
| | | | | | | | | | | | | | | | Also, use the new function where applicable.
* | | | Merge topic 'string-literal-append'Brad King2019-08-191-7/+4
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | da26b3be89 avoid adding multiple consecutive string literals to std::string Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3698
| * | | | avoid adding multiple consecutive string literals to std::stringRolf Eike Beer2019-08-181-7/+4
| |/ / / | | | | | | | | | | | | While at it change some single character additions to be of type char.
* | | | Source sweep: Use cmIsOn instead of cmSystemTools::IsOnSebastian Holtermann2019-08-171-14/+12
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | This replaces invocations of - `cmSystemTools::IsInternallyOn` with `cmIsInternallyOn` - `cmSystemTools::IsNOTFOUND` with `cmIsNOTFOUND` - `cmSystemTools::IsOn` with `cmIsOn` - `cmSystemTools::IsOff` with `cmIsOff`
* | | Source code: Use cmExpandList instead of cmSystemTools::ExpandListArgumentSebastian Holtermann2019-08-141-10/+8
| | |
* | | Merge topic 'cmRemoveQuotes'Kyle Edwards2019-08-131-8/+0
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | 27090096ef cmStringAlgorithms: Add cmRemoveQuotes Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3665
| * | | cmStringAlgorithms: Add cmRemoveQuotesSebastian Holtermann2019-08-091-8/+0
| | | | | | | | | | | | | | | | | | | | - Add `cmRemoveQuotes` function to cmStringAlgorithms - Remove unused removeQuotes inline functions
* | | | Refactor: Convert all instances of CMAKE_BUILD_WITH_CMAKE to CMAKE_BOOTSTRAPKitware Robot2019-08-091-6/+6
|/ / /
* | | Merge topic 'swift-with-interface-libs'Brad King2019-07-301-8/+9
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | 601fe84bd1 Swift: Restore support for enabling with INTERFACE libraries Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Wanderley GuimarĂ£es da Silva <wanderley.guimaraes@gmail.com> Acked-by: Guillaume Egles <gegles@gmail.com> Merge-request: !3624
| * | Swift: Restore support for enabling with INTERFACE librariesBrad King2019-07-291-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The check added in commit b06f4c8a74 (Swift: disallow WIN32_EXECUTABLE properties, 2019-05-31, v3.15.0-rc1~9^2) makes sense only for executables because the `WIN32_EXECUTABLE` property is defined only for them. Running the check on other target types, particularly those that do not link such as INTERFACE libraries, violates internal assumptions. In particular, `GetLinkerLanguage` should not be called on such targets. Fixes: #19528
* | | cmMakefile: Let AddDefinition accept a value as cm::string_viewSebastian Holtermann2019-07-241-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes `cmMakefile::AddDefinition` to take a `cm::string_view` as value argument instead of a `const char *`. Benefits are: - `std::string` can be passed to `cmMakefile::AddDefinition` directly without the `c_str()` plus string length recomputation fallback. - Lengths of literals passed to `cmMakefile::AddDefinition` can be computed at compile time. In various sources uses of `cmMakefile::AddDefinition` are adapted to avoid `std::string::c_str` calls and the `std::string` is passed directly. Uses of `cmMakefile::AddDefinition`, where a `nullptr` `const char*` might be passed to `cmMakefile::AddDefinition` are extended with `nullptr` checks.
* | | cmMakefile: Simplify and rename AddDefinitionBoolSebastian Holtermann2019-07-241-1/+1
| | | | | | | | | | | | | | | | | | | | | This simplifies the `cmMakefile::AddDefinition` method with bool value overload to call the string based `cmMakefile::AddDefinition` method with either an "ON" or "OFF" string. Also the method is renamed to `cmMakefile::AddDefinitionBool`
* | | Merge topic 'ccmake-clear-aliases'Brad King2019-07-091-0/+1
|\ \ \ | |/ / | | | | | | | | | | | | | | | b66d61a8d0 cmGlobalGenerator: Do not persist alias targets across configures Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3529
| * | cmGlobalGenerator: Do not persist alias targets across configuresBrad King2019-07-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | In `ccmake` a single global generator instance may be used for multiple configure step runs. The `cmGlobalGenerator::ClearGeneratorMembers` method is supposed to clear global state that is specific to each configure run but forgot to clear alias targets. Fixes: #19457
* | | modermize: replace some raw pointers w/ `unique_ptr`Alex Turbov2019-06-241-5/+3
|/ /
* | Swift: disallow WIN32_EXECUTABLE propertiesSaleem Abdulrasool2019-06-031-0/+35
| | | | | | | | | | | | | | | | | | | | | | Currently, the compiler does not synthesize the correct entry point for the application and passing the subsystem flag does not work the same way with the Swift linker language. Add a check to prevent the application of `WIN32_EXECUTABLE` to Swift executables until they can be properly supported. This will prevent the need for a future policy change. Closes: #19325
* | Fixing warnings generated by clang 8.0 on WindowsZsolt Parragi2019-05-291-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | * Deprecation removals previously specific to MSVC/Intel now also used by clang * String literals were assigned to non const pointers. These are stored in mutable arrays now * An implicit function pointer to pointer conversion is a Microsoft extension warning is suppressed by an explicit reinterpret_cast * The MSVC specific deprecation macro for jsoncpp was moved after the clang macro to avoid redefinition warnings. This is consistent with how jsoncpp fixed the issue in 36d8cfd7
* | cmSystemTools::Error(): remove const char* overloadVitaly Stakhovsky2019-05-221-4/+4
| |
* | Refactor: Allow cmInstallGenerator::Compute() to return an errorKyle Edwards2019-05-131-1/+3
| | | | | | | | | | | | This is preparation for an upcoming merge request, which will add a new cmInstallGenerator that returns false if there are errors in the Compute() step.
* | Modernize: Enable modernize-raw-string-literal in clang-tidyArtur Ryt2019-04-021-3/+3
| |
* | cmGlobalGenerator: Inline `aRange` acquisition in `for(x:aRange)` invocationsSebastian Holtermann2019-03-251-27/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | Changes the following code snippets in `cmGlobalGenerator` ``` AType aRange = object.getRange(); for ( auto & item: aRange) { ``` to ``` for ( auto & item: object.getRange()) { ```
* | cmGlobalGenerator: Use auto for long iterator typesSebastian Holtermann2019-03-251-44/+30
| |
* | cmMakefile: Use std::unordered_map::emplace to add cmTargets to the listSebastian Holtermann2019-03-211-8/+10
| | | | | | | | | | When adding cmTargets to a cmMakefile, use std::unordered_map::emplace instead of std::unordered_map::insert.
* | cmake: Teach --build mode to support multiple targetsBartosz Kosiorek2019-03-051-43/+56
| | | | | | | | Fixes: #16136
* | cmGlobalGenerator: Change case of methods from GeneratedMakeCommand structBartosz Kosiorek2019-03-041-3/+3
| |
* | cmGlobalGenerator: Remove unused codeBartosz Kosiorek2019-03-041-11/+0
| |
* | Merge topic 'add-xlclang'Brad King2019-02-261-0/+30
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | d9d285c5ad jsoncpp: Fix include order for build within CMake 0d489fab19 libuv: fix atomic ops compilation with xlclang 1699f5c231 Utilities: Suppress warnings in third-party code when using XLClang f709089d84 XLClang: Extract compiler implicit include directories 5c41386357 XLClang: Add policy CMP0089 to present as XL for compatibility 8278237933 XL: Remove overlap with the new XLClang compiler ID 6f5cf2d2c6 XL: Revert "Recognize compilers identified by __ibmxl__" 90c6156aa8 XLClang: Add a new compiler ID for the clang-based XL compiler ... Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2921
| * | XLClang: Add policy CMP0089 to present as XL for compatibilityBrad King2019-02-251-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | We now identify IBM's Clang-based XL compilers, which define `__ibmxl__`, as `XLClang` rather than `XL`. In order to support existing project code that checks for `XL`, add a policy whose OLD behavior is to present the compiler id as `XL` and whose NEW behavior is to present the compiler id as `XLClang` as we really detect it.
* | | Merge topic 'gt-shorter-unique-names'Brad King2019-02-251-5/+12
|\ \ \ | |/ / |/| | | | | | | | | | | | | | 3f685ac3e1 Use shorter names in internal TARGET_PROPERTY expressions Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3009
| * | Use shorter names in internal TARGET_PROPERTY expressionsBrad King2019-02-221-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The change in commit 2f708f5d65 (Make internal TARGET_PROPERTY generator expressions more robust, 2018-09-07, v3.13.0-rc1~94^2~4) introduced globally unique names in synthesized `$<TARGET_PROPERTY:...>` generator. We used the pattern `<target-name>::T<pointer-to-generator-target>` to guarantee uniqueness. However, in projects that require many such expressions to be generated there was a measurable increase in runtime. We had included the target name in the synthesized genex only for human reference during debugging. It is not necessary. Switch to the pattern `:<pointer-to-generator-target>` to shorten the name. Also hand-roll a hex-print loop instead of using sprintf. Together these optimizations get at least some of the time back. Issue: #18964
* | | Merge topic 'drop-MIPSpro'Brad King2019-02-251-7/+0
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | 214fcefa52 Remove now-unused code once used for MIPSpro on IRIX Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3004