summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalXCodeGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Precompile headers: Add support for Xcode generatorCristian Adam2019-08-281-0/+12
| | | | Co-Author: Daniel Pfeifer <daniel@pfeifer-mail.de>
* Source sweep: Replace cmExpandList with the shorter cmExpandedListSebastian Holtermann2019-08-231-4/+2
| | | | | | | | | | | | 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-124/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+4
|\ | | | | | | | | | | | | | | | | 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/+4
| | | | | | | | Also, use the new function where applicable.
* | Merge topic 'string-literal-append'Brad King2019-08-191-4/+2
|\ \ | | | | | | | | | | | | | | | | | | 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-4/+2
| |/ | | | | | | While at it change some single character additions to be of type char.
* | Source sweep: Use cmIsOn instead of cmSystemTools::IsOnSebastian Holtermann2019-08-171-4/+3
|/ | | | | | | | | 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-8/+5
|
* Refactor: Convert all instances of CMAKE_BUILD_WITH_CMAKE to CMAKE_BOOTSTRAPKitware Robot2019-08-091-3/+3
|
* Merge topic 'tidy_inefficient_string'Brad King2019-08-071-1/+1
|\ | | | | | | | | | | | | 18b0330b86 clang-tidy: Enable performance-inefficient-string-concatenation Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3648
| * clang-tidy: Enable performance-inefficient-string-concatenationSebastian Holtermann2019-08-051-1/+1
| | | | | | | | | | | | | | Enables the clang-tidy test performance-inefficient-string-concatenation and replaces all inefficient string concatenations with `cmStrCat`. Closes: #19555
* | cmStringAlgorithms: cmIsSpace, cmTrimWhitespace, cmEscapeQuotes, cmTokenizeSebastian Holtermann2019-08-051-4/+2
|/ | | | | | | | | | This adds the following functions to `cmStringAlgorithms`: - `cmIsSpace` - `cmTrimWhitespace` (moved from `cmSystemTools::TrimWhitespace`) - `cmEscapeQuotes` (moved from `cmSystemTools::EscapeQuotes`) - `cmTokenize` (moved from `cmSystemTools::tokenize` and adapted to accept `cm::string_view`)
* cmMakefile: Let AddDefinition accept a value as cm::string_viewSebastian Holtermann2019-07-241-5/+3
| | | | | | | | | | | | | | | | 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.
* Introduce memory management helper: cm_memory.hxxMarc Chevrier2019-07-141-1/+2
|
* IWYU: Fix handling of <memory> standard headerBrad King2019-07-101-1/+1
| | | | | | | | An old workaround for `std::allocator_traits<>::value_type` lints from IWYU on `std::vector<>` usage breaks IWYU's handling of `<memory>`. Convert the workaround to use the same approach we already use for a workaround of `std::__decay_and_strip<>::::__type` lints. Then update the `<memory>` inclusions to follow the now-correct IWYU lints.
* Use cmAppend to append ranges to std::vector instancesSebastian Holtermann2019-05-231-2/+1
|
* Merge topic 'string-cleanup'Brad King2019-05-171-15/+14
|\ | | | | | | | | | | | | | | 23e8364aed Source: std::string related cleanup Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Sebastian Holtermann <sebholt@web.de> Merge-request: !3324
| * Source: std::string related cleanupVitaly Stakhovsky2019-05-151-15/+14
| |
* | Merge topic 'ninja-pool-custom-command'Brad King2019-05-151-1/+1
|\ \ | |/ |/| | | | | | | | | 9f76961de8 Support job pools in custom commands and targets Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3308
| * Support job pools in custom commands and targetsRosen Matev2019-05-141-1/+1
| | | | | | | | | | | | | | | | | | | | Provide a way for custom commands and targets to set the pool variable of the ninja build statement. Setting `JOB_POOL` is not compatible with `USES_TERMINAL`, which implies the `console` pool. The option is silently ignored with other generators. Closes: #18483
* | cmSystemTools: Add ExpandedListArgument and ExpandedLists methodsSebastian Holtermann2019-05-131-6/+4
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes ------- In `cmSystemTools` this - renames the method `ExpandList` to `ExpandLists` and makes it iterator based and adds the methods - `std::vector<std::string> ExpandedLists(InputIt first, InputIt last)` - `std::vector<std::string> ExpandedListArgument(const std::string& arg, bool emptyArgs)` Both return the `std::vector<std::string>` instead of taking a return vector reference like `cmSystemTools::ExpandLists` and `cmSystemTools::ExpandListArgument`. Motivation ---------- Since C++17 return value optimization is mandatory, so returning a `std:vector<std::string>` from a function should be (at least) as fast as passing a return vector reference to the function. The new methods can replace `cmSystemTools::ExpandLists` and `cmSystemTools::ExpandListArgument` in many cases, which leads to shorter and simpler syntax. E.g. the commonly used pattern ``` if (const char* value = X->GetProperty("A_KEY_STRING")) { std::vector<std::string> valuesList; cmSystemTools::ExpandListArgument(value, valuesList); for (std::string const& i : valuesList) { doSomething(i); } } ``` becomes ``` if (const char* value = X->GetProperty("A_KEY_STRING")) { for (std::string const& i : cmSystemTools::ExpandedListArgument(value)) { doSomething(i); } } ```
* Merge topic 'xcode-extra-sources'Brad King2019-04-121-18/+23
|\ | | | | | | | | | | | | | | 428c1e429f Xcode: Avoid mutating App Bundle targets during generation b4385d5ccc Xcode: Factor out duplicate source group code into lambda Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3208
| * Xcode: Avoid mutating App Bundle targets during generationBrad King2019-04-111-8/+14
| | | | | | | | | | | | | | | | | | | | For `MACOSX_BUNDLE` targets we generate an `Info.plist` automatically and add it to the sources presented to Xcode. Avoid mutating the original target's list of sources to achieve this. Otherwise when we generate the same target again (e.g. in a sub-project's Xcode file) it will look different than the first time and possibly break invariants. Fixes: #19114
| * Xcode: Factor out duplicate source group code into lambdaBrad King2019-04-111-11/+10
| |
* | cmLocalGenerator: Factor IPO logic out of AddLanguageFlagsBrad King2019-04-021-0/+4
| | | | | | | | | | | | The IPO flag logic was added to `AddLanguageFlags` based on my advice. However, this method should really only be about `CMAKE_<LANG>_FLAGS*` variables. Move the IPO logic out to its call sites.
* | Fix invalid ///! doxygen comment line startsSebastian Holtermann2019-03-311-1/+1
| | | | | | | | | | In various places `///!` was used to start a comment line. This is not valid Doygen syntax. This patch replaces `///!` comment starts with `//!`.
* | cmTarget: Move member `*Commands` to implSebastian Holtermann2019-03-231-0/+1
| |
* | Xcode: Create Xcode schemes per targetHarry Mallon2019-03-211-26/+27
| |
* | cmGlobalXCodeGenerator: Prefer std::string over char*Gregor Jasny2019-03-171-5/+5
| |
* | cmake: Teach --build mode to support multiple targetsBartosz Kosiorek2019-03-051-14/+26
| | | | | | | | Fixes: #16136
* | cmGlobalGenerator: Change case of methods from GeneratedMakeCommand structBartosz Kosiorek2019-03-041-10/+10
| |
* | Merge topic 'configurefile-stdstring'Brad King2019-02-201-4/+4
|\ \ | | | | | | | | | | | | | | | | | | 0281f9a4ca cmMakefile::ConfigureFile: Accept `std::string` parameters Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2982
| * | cmMakefile::ConfigureFile: Accept `std::string` parametersVitaly Stakhovsky2019-02-191-4/+4
| |/
* | Xcode: Require at least Xcode 5Gregor Jasny2019-02-161-60/+12
|/
* Xcode: Derive stdlib from CXX flagsGregor Jasny2019-02-071-0/+16
| | | | Closes: #18396
* Xcode: Update default Swift language version for Xcode 10.2Brad King2019-02-041-0/+2
| | | | | | Xcode 10.2 no longer supports Swift language versions before 4.0. Fixes: #18871
* Use cmSourceFile::GetIsGeneratedSebastian Holtermann2019-02-011-1/+1
|
* Merge topic 'xcode-object-dir'Brad King2019-01-311-12/+16
|\ | | | | | | | | | | | | | | 8a7f93d000 Xcode: Fix object library builds with sanitizers enabled eff9c69740 Xcode: Place object library artifacts outside Objects-normal directory Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2885
| * Xcode: Fix object library builds with sanitizers enabledBrad King2019-01-301-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Using `xcodebuild -enableAddressSanitizer YES ...` causes object files to be placed in a different directory name. Xcode provides a placeholder for this that we can use in `OTHER_LDFLAGS` to reference object files for linking the dependents of object libraries. However, CMake's features for installing and exporting object libraries depend on knowing the real path with no placeholders. For these cases, use the default object directory. Users will then have to choose between sanitizers and the installation and export features, but both will work individually. Fixes: #16289
| * Xcode: Place object library artifacts outside Objects-normal directoryBrad King2019-01-301-12/+14
| | | | | | | | | | | | | | | | | | | | | | The `CONFIGURATION_BUILD_DIR` value in the Xcode project file specifies where to place the library artifact. For object libraries we've used the `Objects-normal` directory to hide away the `.a` that we otherwise cannot stop Xcode from producing. The parent of this directory is also specific to the target and does not vary with Xcode's sanitizer features, so move the artifact there. Issue: #16289
* | clang-tidy: Use `= delete`Regina Pfeifer2019-01-291-2/+5
|/
* Merge topic 'add_consistent_verbose_build_flag'Brad King2019-01-291-24/+19
|\ | | | | | | | | | | | | | | | | | | | | | | 66801f4d40 cmake: Add tests for verbose output to --build mode 439fe2e253 cmake: Add options for verbose output to --build mode 638667efa2 cmake: cmcmd.cxx fix "The arguments are" comments 3ca4402966 ctest: Fix --build-and-test without --build-target on Xcode cb6c233ecc cmake: Add -hideShellScriptEnvironment xcodebuild option 1a45266cb5 cmGlobalGenerator: Add a class that represent the build command Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2708
| * ctest: Fix --build-and-test without --build-target on XcodeFlorian Maushart2019-01-251-5/+7
| |
| * cmake: Add -hideShellScriptEnvironment xcodebuild optionFlorian Maushart2019-01-251-0/+3
| | | | | | | | | | For CMake's build tool mode add -hideShellScriptEnvironment if version is XCode 7.0 or above
| * cmGlobalGenerator: Add a class that represent the build commandRobert Maynard2019-01-251-21/+11
| | | | | | | | | | | | This refactors a std::vector<std::string> into a class so that we can extend the features to represent things such as multiple chained commands in the future.
* | Merge topic 'cmoutputconverter-simplify'Brad King2019-01-291-1/+1
|\ \ | | | | | | | | | | | | | | | | | | b6a957c969 cmOutputConverter: move ConvertToRelativePath to cmStateDirectory. Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2831
| * | cmOutputConverter: move ConvertToRelativePath to cmStateDirectory.Bruno Manganelli2019-01-271-1/+1
| | |
* | | Merge topic 'exclude_from_all'Brad King2019-01-251-6/+1
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | dc6888573d Pass EXCLUDE_FROM_ALL from directory to targets Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2816
| * | | Pass EXCLUDE_FROM_ALL from directory to targetsZack Galbreath2019-01-211-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | When a target is created it now inherits the EXCLUDE_FROM_ALL property from its directory. This change makes it possible to include a target in "all", even if its directory has been marked as EXCLUDE_FROM_ALL.