summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* | | Merge topic 'fix-legacy-implicit-includes'Brad King2019-02-191-34/+27
|\ \ \ | |/ / |/| / | |/ | | | | | | | | | | 890bae524c Do not explicitly report "standard" include directories as implicit 5c171ca898 Restore unconditional use of "standard" include directories 9502276f82 Prefix implicit include directories with sysroot on construction Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2981
| * Do not explicitly report "standard" include directories as implicitBrad King2019-02-181-20/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit 1293ed8507 (ParseImplicitIncludeInfo: keep implicit incl. consistent when rerunning cmake, 2019-01-30, v3.14.0-rc1~26^2) we did not account for `CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES`. This variable lets platform modules or toolchain files specify directories that are to be explicitly passed as standard include directories. These include directories are used by the test project from which we extract implicit include directories so they appear in the parsed results whether or not the compiler really considers them implicit. Exclude these entries from the computed implicit include directories since they are not actually implied by the compiler when we invoke it with "standard" include directories passed explicitly. Instead teach the build system generators to treat the "standard" directories as implicit for purposes of excluding them from appearing earlier in the compiler command line due to `include_directories` and `target_include_directories` calls. Issue: #18936, #18944
| * Restore unconditional use of "standard" include directoriesBrad King2019-02-181-3/+1
| | | | | | | | | | | | | | | | | | | | | | `CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES` is meant to unconditionally add explicitly specified include directories to compile lines. In commit 5f34bdc7f9 (cmLocalGenerator: Refactor `GetIncludeDirectoriesImplicit` method, 2019-01-25, v3.14.0-rc1~65^2~1) a condition was accidentally added to exclude implicit include directories. Drop that condition. Fixes: #18936
| * Prefix implicit include directories with sysroot on constructionBrad King2019-02-181-12/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 7cd65c97fa (Add CMAKE_SYSROOT variable to set --sysroot when cross compiling., 2013-04-13, v3.0.0-rc1~342^2) we have prefixed the value of `CMAKE_SYSROOT` to implicit include directories. This was done because we hard-coded `/usr/include` as an implicit include directory without accounting for the sysroot. Instead we should prefix the hard-coded paths when they are constructed. Update the `Platform/UnixPaths` module to do this as `Platform/Darwin` already does. Since commit 5990ecb741 (Compute implicit include directories from compiler output, 2018-12-07, v3.14.0-rc1~108^2) the values of the `CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES` variables are computed from a real compiler invocation so they already account for the sysroot prefix. In commit 6fc3382944 (Update logic for sysroot in detected implicit include directories, 2019-02-13, v3.14.0-rc2~6^2) we attempted to apply the prefix conditionally, but that is incorrect because the compiler's real implicit include directories are not all under the sysroot. Instead assume that all implicit include directories in `CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES` already have the sysroot prefix if needed. Code that constructs the value must be responsible for that because it is the only place that knows.
* | Merge topic 'fix-legacy-implicit-includes'Brad King2019-02-141-7/+21
|\ \ | |/ | | | | | | | | | | | | | | | | 6fc3382944 Update logic for sysroot in detected implicit include directories 2ad14ef4ea cmAlgorithms: Add cmHasPrefix to match existing cmHasSuffix 557b2d6e65 Fix regression in -I/usr/include exclusion logic 017598a444 macOS: Fix addition of <sdk>/usr/include to default implicit include dirs Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2957
| * Update logic for sysroot in detected implicit include directoriesBrad King2019-02-131-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 5990ecb741 (Compute implicit include directories from compiler output, 2018-12-07, v3.14.0-rc1~108^2) the values of the `CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES` variables are computed from a real compiler invocation. In this case the paths under the sysroot should already have the sysroot prefix so we should no longer have to add the sysroot prefix. However, it is also possible for project code to add its own paths to `CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES` without the sysroot prefix and expect the historical addition of the sysroot prefix to be preserved. Try to account for both cases by conditionally adding the sysroot prefix on implicit include directories that do not already have it.
| * Fix regression in -I/usr/include exclusion logicBrad King2019-02-131-6/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | The change in commit 15ad830062 (Refactor exclusion of -I/usr/include to avoid per-language values, 2019-01-21, v3.14.0-rc1~108^2~4) caused the exclusion to apply to Fortran, but it was only meant for C, CXX, and CUDA. The purpose of the change was to prepare for the value of `CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES` to be computed from the actual compiler instead of hard-coded. We need to preserve exclusion of `-I/usr/include` if the compiler has any implicit include directory that looks intended to replace it, e.g. `<sdk>/usr/include` on macOS. Fixes: #18914
* | Merge topic 'modernize-for-loops'Brad King2019-02-111-8/+5
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | 01b2d6ab74 Modernize: Use ranged for-loops when possible 15bdbec017 cmAlgorithms: Make cmRange advance/retreat safe for rvalues Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Daniel Pfeifer <daniel@pfeifer-mail.de> Merge-request: !2901
| * | Modernize: Use ranged for-loops when possibleArtur Ryt2019-02-071-8/+5
| |/ | | | | | | | | | | | | Replaced most manual `const_iterator`-based loops and some reverse-iterator loops with range loops. Fixes: #18858
* | cmMakefile::GetRequiredDefinition: return const std::string&Vitaly Stakhovsky2019-02-071-2/+2
|/
* Merge topic 'cmoutputconverter-simplify'Brad King2019-01-291-6/+13
|\ | | | | | | | | | | | | 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-6/+13
| |
* | Merge topic 'message-stdstring'Brad King2019-01-291-2/+2
|\ \ | | | | | | | | | | | | | | | | | | 186d9b083d cmSystemTools::Message: Add overload accepting std::string Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2869
| * | cmSystemTools::Message: Add overload accepting std::stringVitaly Stakhovsky2019-01-281-2/+2
| | |
* | | cmLocalGenerator: Refactor `GetIncludeDirectoriesImplicit` methodSebastian Holtermann2019-01-281-45/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use a dedicated `std::set` for implicit include directories instead of (ab)using the emitted variable. This in combination with lambdas makes it easier to comprehend which paths are emitted. For the implicit include directories we used to omit the `CMAKE_SYSROOT_COMPILE`/`CMAKE_SYSROOT` prefix. This has been changed and the implicit paths are returned prefixed. Implicit include directory returning is only ever used by QtAutoGen which requires prefixed paths. QtAutoGen passes the (implicit) include paths to the `moc` which isn't aware of `CMAKE_SYSROOT_COMPILE`/`CMAKE_SYSROOT`.
* | | cmLocalGenerator: Simplify `GetIncludeDirectories`Sebastian Holtermann2019-01-281-16/+29
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch strips the `stripImplicitDirs` and `appendAllImplicitDirs` parameters from the `cmLocalGenerator::GetIncludeDirectories` method and makes it a wrapper into the new `cmLocalGenerator::GetIncludeDirectoriesImplicit` method. `cmLocalGenerator::GetIncludeDirectoriesImplicit` is the renamed old implementation of `cmLocalGenerator::GetIncludeDirectories` and still accepts `stripImplicitDirs` and `appendAllImplicitDirs`. The motivation is that there's only *one* case where `cmLocalGenerator::GetIncludeDirectories` is called with the `stripImplicitDirs` parameter being `false` (QtAutoGen), but many other places where it is called using the `true` default value. QtAutoGen is modified to use `cmLocalGenerator::GetIncludeDirectoriesImplicit` directly. In two use cases of `cmLocalGenerator::GetIncludeDirectories` the manually set `true` value for `stripImplicitDirs` is removed.
* | cmSystemTools::Error(): new overload accepting std::stringVitaly Stakhovsky2019-01-231-3/+3
| |
* | Merge topic 'getmodulesfile-string'Brad King2019-01-231-2/+2
|\ \ | | | | | | | | | | | | | | | | | | 2993fc347a cmMakefile: GetModulesFile() accepts std::string param Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2838
| * | cmMakefile: GetModulesFile() accepts std::string paramVitaly Stakhovsky2019-01-211-2/+2
| |/
* | Merge topic 'implicit-includes'Brad King2019-01-221-8/+16
|\ \ | |/ |/| | | | | | | | | | | | | | | | | 5990ecb741 Compute implicit include directories from compiler output d751d2d2ed CMakeDetermineCompilerABI: set locale to C for try_compile() c765ae495a CMakeDetermineCompilerABI: pass verbose flag during compilation 8c5221fb1f try_compile: Preserve special characters in COMPILE_DEFINITIONS 15ad830062 Refactor exclusion of -I/usr/include to avoid per-language values Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2716
| * Refactor exclusion of -I/usr/include to avoid per-language valuesBrad King2019-01-211-8/+16
| | | | | | | | | | | | | | | | | | | | | | Add a `CMAKE_PLATFORM_IMPLICIT_INCLUDE_DIRECTORIES` to contain the hard-coded list of paths to be excluded from `-I` arguments so that the values remain excluded even if the per-language `CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES` variants change. This is needed to preserve our historical exclusion of `-I/usr/include` even when it is not a real implicit include directory. A policy may be needed to remove it later.
* | clang-tidy: Use emplaceRegina Pfeifer2019-01-171-13/+13
|/
* Factor out enum MessageType into dedicated headerBruno Manganelli2019-01-161-14/+14
| | | | Reduce the number of files relying on `cmake.h`.
* PIE link options: Update strategy to fix performance regressionMarc Chevrier2018-12-191-2/+8
| | | | Fixes: #18700
* POSITION_INDEPENDENT_CODE: Manage link flags for executablesMarc Chevrier2018-11-111-0/+32
| | | | Fixes: #14983, #16561
* Using front() and back() instead of calculationsCengizhan Pasaoglu2018-11-061-4/+4
|
* Merge topic 'msvc-custom-rc-mt'Brad King2018-11-021-0/+1
|\ | | | | | | | | | | | | | | | | | | | | bd9bfc6449 MSVC: Respect CMAKE_RC_COMPILER and CMAKE_MT in vs_link_{dll,exe} 0033676796 CUDA: Enable RC language on Windows 02f566a559 MSVC: Factor out enable_language(RC) call into helper macro b601bb6f1c CUDA: Find CMAKE_LINKER on Windows 3eebe28ef4 cmLocalNinjaGenerator: Simplify CreateRulePlaceholderExpander Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2424
| * MSVC: Respect CMAKE_RC_COMPILER and CMAKE_MT in vs_link_{dll,exe}Mateusz Zych2018-10-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | CMake commands vs_link_dll and vs_link_exe, performing linking on MSVC, are responsible for calling resource compiler and manifest tool. Before this commit, both of these tools were called directly, with the expectation that they are available in the `PATH`. This has been fixed by respecting CMake variables `CMAKE_RC_COMPILER` and `CMAKE_MT` defining paths to these tools. Fixes: #17804
* | cmLocalGenerator::AppendDefines: Remove const char* overloadsVitaly Stakhovsky2018-10-261-3/+3
| | | | | | | | Accept const std::string& arguments only
* | Add generator APIs to get build settings with backtracesBrad King2018-10-181-34/+91
| | | | | | | | | | | | In cmGeneratorTarget and cmLocalGenerator we offer several APIs to get build settings like include directories, compile definitions, source files, etc. Add corresponding APIs that include backtrace information.
* | cmLocalGenerator: Make MoveSystemIncludesToEnd file-localBrad King2018-10-181-5/+6
| |
* | cmGeneratorTarget::GetExportMacro: return const std::string*Vitaly Stakhovsky2018-10-161-2/+2
| |
* | Merge topic 'remove-AddCompileDefinitions'Brad King2018-10-111-11/+3
|\ \ | | | | | | | | | | | | | | | | | | 8f076acdb0 cmLocalGenerator: Remove AddCompileDefinitions method Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2470
| * | cmLocalGenerator: Remove AddCompileDefinitions methodBrad King2018-10-101-11/+3
| |/ | | | | | | | | | | | | This method offers the same definitions as `GetTargetDefines` except that it excludes the "export" macro on shared libraries. Update call sites to use `GetTargetDefines` instead. Some of them were incorrectly excluding the export macro.
* | add_subdirectory: Run subdirectory install rules in correct orderKyle Edwards2018-10-101-16/+47
|/ | | | | | | | | Before this change, install rules created by add_subdirectory() would be executed after all of the top-level install rules, even if they were declared before the top-level rules. This change adds a new policy, CMP0082, which interleaves the add_subdirectory() install rules with the other install rules so they are run in the correct order.
* Restore possibly regressed CMP0018 logicBrad King2018-09-191-1/+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.
* cmMakefile: Make GetSafeDefinition return std::string const&Vitaly Stakhovsky2018-09-181-6/+6
|
* Merge topic 'replace-os-x-name-with-macos'Brad King2018-09-111-1/+1
|\ | | | | | | | | | | | | | | | | | | ab2e35d614 Replace occurrences of "Mac OS X" with "macOS" in comments fc1602456a Help: Replace occurrences of "Mac OS X" with "macOS" Acked-by: Kitware Robot <kwrobot@kitware.com> Reviewed-by: Gregor Jasny <gjasny@googlemail.com> Reviewed-by: Clinton Stimpson <clinton@elemtech.com> Merge-request: !2351
| * Replace occurrences of "Mac OS X" with "macOS" in commentsBartosz Kosiorek2018-09-101-1/+1
| | | | | | | | | | | | | | | | Apple's main Operating system changed their name from OS X to macOS: https://www.engadget.com/2016/06/13/os-x-is-now-macos/ Revise source comments accordingly.
* | 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