summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Merge topic 'add-non-empty-configurations-getter'Brad King2019-09-031-5/+2
|\ | | | | | | | | | | | | 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-5/+2
| |
* | cmSourceFile: Rename mutating GetFullPath() overloadDaniel Eiband2019-08-291-2/+2
|/ | | | Rename mutating GetFullPath() overload to ResolveFullPath().
* Merge topic 'precompile-headers'Brad King2019-08-291-0/+83
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 8da78d4efe Precompile headers: Update documentation 5772930164 Precompile headers: Add unit tests 519606704e Precompile headers: Add support for Visual Studio generators 28be170fbc Precompile headers: Add support for Xcode generator b8626261e9 Precompile headers: Add methods to generate PCH sources 375d01c680 PCH: add example/test 9b6797e71d PCH: add target_precompile_headers command 0467a2f91b PCH: add PRECOMPILE_HEADERS to special properties Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Daniel Pfeifer <daniel@pfeifer-mail.de> Acked-by: Ivan171 <heavenandhell171@gmail.com> Acked-by: Stanislav Ershov <digital.stream.of.mind@gmail.com> Acked-by: Steve Mokris <smokris@softpixel.com> Acked-by: Evgeniy Dushistov <dushistov@mail.ru> Acked-by: Danila Malyutin <flashmozzg@gmail.com> Acked-by: Viktor Kirilov <vik.kirilov@gmail.com> Acked-by: Lucas Zhao <zhaopf6@163.com> Merge-request: !3553
| * Precompile headers: Add methods to generate PCH sourcesCristian Adam2019-08-281-0/+83
| | | | | | | | Co-Author: Daniel Pfeifer <daniel@pfeifer-mail.de>
* | Merge topic 'swift-version'Brad King2019-08-271-0/+11
|\ \ | |/ |/| | | | | | | | | 369c48ee43 Swift: honour `-swift-version` in Ninja generator Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3685
| * Swift: honour `-swift-version` in Ninja generatorSaleem Abdulrasool2019-08-261-0/+11
| | | | | | | | | | | | Swift has supported `CMAKE_Swift_LANGUAGE_VERSION` and `Swift_LANGUAGE_VERSION` but didn't apply that to Ninja generated targets. Consider the property when calculating the flags.
* | Source sweep: Replace cmExpandList with the shorter cmExpandedListSebastian Holtermann2019-08-231-24/+12
|/ | | | | | | | | | | | 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-15/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 'isolate-declarations'Brad King2019-08-221-2/+2
|\ | | | | | | | | | | | | d331021255 clang-tidy: isolate declarations for readability Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3704
| * clang-tidy: isolate declarations for readabilityRegina Pfeifer2019-08-201-2/+2
| |
* | Merge topic 'cm-contains'Brad King2019-08-211-9/+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-9/+5
| | | | | | | | Also, use the new function where applicable.
* | Source sweep: Use cmIsOn instead of cmSystemTools::IsOnSebastian Holtermann2019-08-171-7/+6
|/ | | | | | | | | 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-14/+14
|
* Merge topic 'strcat-localgenerator'Kyle Edwards2019-08-131-92/+48
|\ | | | | | | | | | | | | | | 62659100aa cmLocalGenerator: Use cmStrCat Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Sebastian Holtermann <sebholt@web.de> Merge-request: !3671
| * cmLocalGenerator: Use cmStrCatRegina Pfeifer2019-08-091-92/+48
| | | | | | | | Grep for '[A-Z]_";' to find places that could benefit from cmStrCat.
* | Refactor: Convert all instances of CMAKE_BUILD_WITH_CMAKE to CMAKE_BOOTSTRAPKitware Robot2019-08-091-1/+1
|/
* 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: Move string functions to the new cmStringAlgorithms.hSebastian Holtermann2019-07-291-0/+1
| | | | | This adds the `cmStringAlgorithms.h` header and moves all string functions from `cmAlgorithms.h` to `cmStringAlgorithms.h`.
* cmMakefile: Let AddDefinition accept a value as cm::string_viewSebastian Holtermann2019-07-241-2/+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.
* Swift: fix static library handlingSaleem Abdulrasool2019-07-191-5/+7
| | | | | | Handle static libraries similar to shared libraries. Do not pass along the shared library flags raw as that will pass flags for the linker to the driver which is incorrect.
* AIX: Explicitly compute executable exports for both XL and GNUBrad King2019-07-151-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | On AIX, symbols in executables must be exported in order to be visible to modules (plugins) they load via `dlopen`. Prior to policy `CMP0065`, CMake linked all executables with flags to export symbols, but the NEW behavior for that policy is to do so only for executables that have the `ENABLE_EXPORTS` target property set. In both cases, CMake has always used the AIX linker option `-bexpall` option to export symbols from executables. This has worked fairly well with the XL compiler, but with the GNU compiler it works only for C ABI symbols. The reason is that `-bexpall` does not export symbols starting in `_` but the GNU C++ ABI mangles all symbols with a leading `_`. Therefore we have only supported C ABI plugins with the GNU compiler on AIX. Some projects have tried to work around this by replacing `-bexpall` with `-bexpfull`, but the latter often exports symbols that we do not want exported. Avoid using `-bexpall` for executables by instead using by our own internal `ExportImportList` script to compute symbol export lists from the object files to be linked into an executable. Pass the explicitly computed export list to the AIX linker's `-bE:...` option. We already do this for shared object exports. Issue: #19163
* IWYU: Fix handling of <memory> standard headerBrad King2019-07-101-1/+3
| | | | | | | | 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.
* Normalize paths when checking for implicit include dirsDaniel Scharrer2019-06-221-3/+5
| | | | | GCC replaces implicit include directories with user-supplied ones if they point to the same directory, even if the path strings differ.
* Support per-language library link flagsSaleem Abdulrasool2019-06-061-4/+17
| | | | | | | | | | This changes the behaviour of the generators to use a per-language library search path flag. This is needed for multi-language projects with different compilers (e.g. cl + gfortran). Since the adjusted variable has been part of the user settings, we control this based on a policy. Fixes: #19307
* Merge topic 'swift-linker-flags'Brad King2019-06-041-49/+62
|\ | | | | | | | | | | | | 7456739e24 Swift: avoid `CMAKE_{EXE,SHARED}_LINKER_FLAGS` Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3406
| * Swift: avoid `CMAKE_{EXE,SHARED}_LINKER_FLAGS`Saleem Abdulrasool2019-06-031-49/+62
| | | | | | | | | | | | | | | | | | | | | | Avoid the use of `CMAKE_{EXE,SHARED}_LINKER_FLAGS` when linking with the Swift language. This required hoisting the executable flags of `CMAKE_CREATE_WIN32_EXE`, `CMAKE_CREATE_CONSOLE_EXE`, and `CMAKE_EXE_EXPORTS_*_FLAG` earlier to avoid a second clause which checks the language. This allows for mixed-language Swift projects to properly link on Windows. Fixes #19298
* | The error message for VISIBILITY_PRESET now documents valid options.Robert Maynard2019-06-031-1/+3
|/ | | | | Rather than just state the value for VISIBILITY_PRESET was invalid, we additionally list the accepted values.
* Merge topic 'implicit-includes-CPATH'Brad King2019-05-311-3/+25
|\ | | | | | | | | | | | | 2d0b0e2b9d Do not exclude include directories made implicit by CPATH Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3395
| * Do not exclude include directories made implicit by CPATHBrad King2019-05-301-3/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Entries of the `CPATH` environment variable are implicitly searched as include directories by some C/C++ compilers. Since commit 5990ecb741 (Compute implicit include directories from compiler output, 2018-12-07, v3.14.0-rc1~108^2) these entries are detected by CMake and included in the `CMAKE_{C,CXX}_IMPLICIT_INCLUDE_DIRECTORIES` variables. However, we should not exclude them from explicit specification via `-I` or particularly `-isystem` because they are meant as user-specified include directories that can be re-ordered without breaking compiler builtin headers. In particular, we need explicit requests via `include_directories` with the `SYSTEM` option to result in `-isystem` so that third-party headers do not produce warnings. Co-Author: Ben Boeckel <ben.boeckel@kitware.com> Fixes: #19291
* | Use cmAppend to append ranges to std::vector instancesSebastian Holtermann2019-05-231-7/+6
| |
* | MSVC: Add support for /JMC (Just My Code)Luca Cappa2019-05-141-0/+26
| |
* | MSVC: Add abstraction for runtime library selectionBrad King2019-04-171-2/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace our hard-coded defaults for `/MD` and `/MDd` with a first-class abstraction to select the runtime library from an enumeration of logical names. We've long hesitated to do this because the idea of "runtime library selection" touches on related concepts on several platforms. Avoid that scope creep by simply defining an abstraction that applies only when targeting the MSVC ABI on Windows. Removing the old default flags requires a policy because existing projects may rely on string processing to edit them and choose a runtime library under the old behavior. Add policy CMP0091 to provide compatibility. Fixes: #19108
* | Merge topic 'modernize-raw-string-literal'Brad King2019-04-041-1/+1
|\ \ | | | | | | | | | | | | | | | | | | 30bb14c657 Modernize: Enable modernize-raw-string-literal in clang-tidy Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3184
| * | Modernize: Enable modernize-raw-string-literal in clang-tidyArtur Ryt2019-04-021-1/+1
| | |
* | | cmLocalGenerator: Factor IPO logic out of AddLanguageFlagsBrad King2019-04-021-3/+10
|/ / | | | | | | | | | | 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.
* | Modernize: Prefer .substr in place of .c_str() + intArtur Ryt2019-03-301-1/+1
| | | | | | | | | | | | A lot of temporary/local strings were created out of C-strings substr can utilize current string size, so in theory be a little more efficient.
* | Merge topic 'implicit-includes-autogen'Brad King2019-03-291-8/+13
|\ \ | |/ | | | | | | | | | | a8b7cbb787 Autogen: Do not treat hard-coded -I/usr/include exclusion as implicit include Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3159
| * Autogen: Do not treat hard-coded -I/usr/include exclusion as implicit includeSebastian Holtermann2019-03-281-8/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `cmLocalGenerator::GetIncludeDirectoriesImplicit` method is called by `cmQtAutoGenInitializer` to get the compiler's list of implicit include directories. Since commit 557b2d6e65 (Fix regression in -I/usr/include exclusion logic, 2019-02-13, v3.14.0-rc2~6^2~2) the method hard-codes exclusion of `/usr/include` for historical reasons. However, it should not be reported as a real implicit include directory unless the compiler really has it. Refactor the logic to distinguish the hard-coded exclusion of `/usr/include` from the real list of implicit include directories. Fixes: #19100
* | Merge topic 'error-consolidate'Brad King2019-02-251-4/+4
|\ \ | | | | | | | | | | | | | | | | | | 9dd255548d cmSystemTools::Error: consolidate parameters into single std::string Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2995
| * | cmSystemTools::Error: consolidate parameters into single std::stringVitaly Stakhovsky2019-02-201-4/+4
| | |
* | | Merge topic 'systools-stdstring3'Brad King2019-02-251-1/+1
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | 4e315e9449 cmSystemTools: More functions accept `std::string` params Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2999
| * | | cmSystemTools: More functions accept `std::string` paramsVitaly Stakhovsky2019-02-201-1/+1
| |/ /
* | | Merge topic 'fix-implicit-includes-fortran'Brad King2019-02-251-9/+15
|\ \ \ | |/ / |/| / | |/ | | | | | | | | 3dc81a48ff Fortran: Do not suppress explicit use of implicit include directories Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Michael Hirsch, Ph.D. <michael@scivision.co> Merge-request: !2994
| * Fortran: Do not suppress explicit use of implicit include directoriesBrad King2019-02-201-9/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 2e91627dea (ParseImplicitIncludeInfo: add Fortran implicit include handling, 2019-01-25, v3.14.0-rc1~73^2) we actually populate `CMAKE_Fortran_IMPLICIT_INCLUDE_DIRECTORIES` for the first time. This value may be useful to project code to pass to other tooling that wants to preprocess the way Fortran does, so we should compute the value. However, compilers like `gfortran` do not actually search their own implicit include directories for `.mod` files. The directories must be passed via `-I` in order for `.mod` files in them to be found. Since Fortran has no standard library header files that we need to avoid overriding, it is safe to *not* filter out implicit include directories from those passed explicitly via `-I` options. Skip this filtering so that include directories specified by project code to find `.mod` files will be searched by the compiler even if they happen to be implicitly searched by the preprocessor. Fixes: #18914
* | Merge topic 'configurefile-stdstring'Brad King2019-02-201-4/+5
|\ \ | | | | | | | | | | | | | | | | | | 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/+5
| | |
* | | Merge topic 'modernize-for-loops-c-arrays'Brad King2019-02-191-26/+23
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | 706b93fa55 Modernize: C-arrays and loops over them Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2951
| * | | Modernize: C-arrays and loops over themArtur Ryt2019-02-151-26/+23
| |/ / | | | | | | | | | | | | It replaces C arrays with deduced std::initializer_lists or std::array what makes enables for-loop over them.