summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
Commit message (Collapse)AuthorAgeFilesLines
* cmValue: Use operator* explicitly to convert to std::string; avoid extra callVitaly Stakhovsky2023-01-161-1/+2
|
* cmake::CreateProfilingEntry: Refactor to take lambda for argsKyle Edwards2022-11-111-1/+14
|
* cmMakefileProfilingData: Refactor to use RAIIKyle Edwards2022-10-261-7/+6
| | | | And add a more generic StartEntry() method.
* Merge topic 'trace-try_compile'Brad King2022-10-171-0/+3
|\ | | | | | | | | | | | | | | 5ba51621af try_compile: Propagate --trace through try_compile Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !7757
| * try_compile: Propagate --trace through try_compileMatthew Woehlke2022-10-111-0/+3
| | | | | | | | | | Add ability to specify another cmake instance from which to get the trace output target. Use this during try_compile.
* | Add deprecation warnings for policies CMP0108 and belowBrad King2022-10-121-2/+2
|/ | | | | | | The OLD behaviors of all policies are deprecated, but only by documentation. Add an explicit deprecation diagnostic for policies introduced in CMake 3.18 and below to encourage projects to port away from setting policies to OLD.
* Merge topic 'add_subdirectory_system'Brad King2022-09-271-1/+5
|\ | | | | | | | | | | | | 2eb30a7036 add_subdirectory: Add SYSTEM option Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7399
| * add_subdirectory: Add SYSTEM optionDa Quexian2022-09-261-1/+5
| | | | | | | | | | Fixes: #22401 Signed-off-by: Da Quexian <daquexian566@gmail.com>
* | Merge topic 'check-library-properties-fix-performances-regression'Brad King2022-09-091-25/+0
|\ \ | | | | | | | | | | | | | | | | | | | | | 985b4c82a6 Check link libraries properties: fix performances regression a47eef32a3 renames method FinalizeTargetCompileInfo() in FinalizeTargetConfiguration(). Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7651
| * | Check link libraries properties: fix performances regressionMarc Chevrier2022-09-071-25/+0
| | | | | | | | | | | | Fixes: #23939
* | | return(): Propagate variables to result scopeMarc Chevrier2022-09-031-0/+1
| | | | | | | | | | | | Fixes: #23871
* | | cmMakefile: add RaiseScope for list of variablesMarc Chevrier2022-09-031-0/+12
| | |
* | | cmMakefile::VariablePushPop: helper class to manage variable scopesMarc Chevrier2022-08-221-0/+13
| | |
* | | cmMakefile: Dedupe languages when enabling themfriendlyanon2022-06-301-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | cmMakefile::EnableLanguage() now deduplicates the languages argument and emits an author warning listing the languages that were defined multiple times in a single call. Fixes: #23596
* | | cmMakefile: Refactor parameter and variable names for EnableLanguagefriendlyanon2022-06-301-12/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit 731369ef9c (ENH: try to initialize all languages at the same time, 2004-08-27, v2.4.0~2899) the languages parameter name for cmMakefile::EnableLanguage() was changed to "std::vector languages" in the declaration, however the definition had "std::vector lang". Furthermore, the variable names in the definition had confusing names, such as the "i" variable in the loop which referred to an iterator at one point, but no longer does.
* | | Add cmake_language(GET_MESSAGE_LOG_LEVEL) sub commandAlexandru Croitor2022-06-281-0/+23
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new sub-command writes a string representation of the current log level to the output variable given to the sub-command. Given that the log-level might be set either via the --log-level command line option or via the CMAKE_MESSAGE_LOG_LEVEL cache / regular variables, the priority for each of the log level sources is as follows, with the first one being the highest: 1) --log-level 2) CMAKE_MESSAGE_LOG_LEVEL regular variable 3) CMAKE_MESSAGE_LOG_LEVEL cache variable 4) default log level (STATUS) Fixes: #23572
* | Add deprecation warnings for policies CMP0102 and belowBrad King2022-06-141-1/+1
|/ | | | | | | The OLD behaviors of all policies are deprecated, but only by documentation. Add an explicit deprecation diagnostic for policies introduced in CMake 3.17 and below to encourage projects to port away from setting policies to OLD.
* cmSystemTools: Fix 'ErrorOccurred' spellingFeRD (Frank Dana)2022-06-131-19/+19
| | | | | | | | Rename the booleans 's_ErrorOccured' and 's_FatalErrorOccured' to 's_ErrorOccurred' and 's_FatalErrorOccurred', respectively. Rename the getters and setters to 'Get[Fatal]ErrorOccurred' and 'Set[Fatal]ErrorOccurred', and fix all uses across the codebase.
* clang-tidy: address `google-readability-casting` lintsBen Boeckel2022-05-241-1/+1
| | | | At least those involving `static_cast`.
* clang-tidy: address `modernize-use-default-member-init` lintsBen Boeckel2022-05-241-10/+4
|
* cmListFileBacktrace: Clarify call sites that only push a file pathBrad King2022-04-011-3/+6
| | | | | This removes the last part of the `cmListFileBacktrace` interface that needs to know the type of data in its stack.
* Trace: process else and elseif commands correctlyBraulio Valdivielso Martinez2022-03-251-7/+8
| | | | | | | | | | | | | | | | | There have been two bugs reported about the `else` and `elseif` commands in the context of the tracing functionality and the json-v1 format (#23191 #22315). In essence, the reported traces referred to the layer of the stacktrace immediately on top of the expected ones. This MR fixes both issues. My solution adds a new parameter to the `PrintCommandTrace` function, `commandMissingFromStack`, that callers can specify if the command they want to report a trace for is not a regular part of the stack maintained in `cmMakefile`. This is only the case for `else` and `elseif`. The other bug is fixed by having the caller pass a `cmListFileBacktrace`, which helps in getting the right lines, file names... for the reported command. Fixes: #23191 #22315
* find_package: Add support for default GLOBAL imported targetsJohn Parent2022-03-101-0/+5
| | | | | | | | | Allow find package to promote scope of imported targets by specifying an argument to `find_package` or by specifying a CMake variable. * Add support for CMAKE_GLOBAL_IMPORT_SCOPE variable * Add support for GLOBAL argument to find_package Additionally add testing for above features.
* Genex-LINK_GROUP: Add possibility to group libraries at link stepMarc Chevrier2022-02-281-9/+9
| | | | Fixes: #23121
* Merge topic 'debug-find'Brad King2022-02-111-0/+19
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 38de1bef2d find_package: Improve --debug-find-pkg= when using a find module d634d20397 find_package: Avoid printing debug output header multiple times df3e29450a find_package: Mention package name in Config mode debug output 636ca7f25c find_package: Fix find module name in --debug-find output 596e185409 find_package: Improve formatting of --debug-find output 2f43527574 Tests: Improve order of RunCMake.find_package cases a690523fcf cmFindPackageCommand: Drop ComputeIfDebugModeWanted overload Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !6973
| * find_package: Improve --debug-find-pkg= when using a find moduleBrad King2022-02-101-0/+19
| | | | | | | | | | | | | | | | | | Extend the feature added by commit d7b18895bc (cmake: Add filtered debug-find options, 2021-12-07, v3.23.0-rc1~217^2) to enable debug output for `find_*` calls within a find module or cmake package configuration file. Fixes: #23211
* | Trace: include `line_end` field in json-v1 formatBraulio Valdivielso Martinez2022-02-091-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After !6954 got merged, it has become easier for tools to get full stack-traces for runtime traces of a CMake program. The trace information already included in the JSON objects (line number, source file path) allows tools that display these stack traces to print the CMake source code associated to them. However, CMake commands may spawn multiple lines, and the JSON information associated to a trace only contains the line in which the command started, but not the one in which it ended. If tools want to print stack traces along the relevant source code, and they want to print the whole command associated to the stack frame, they will have to implement their own CMake language parser to know where the command ends. In order to simplify the life of those who want to write tooling for CMake, this commit adds a `line_end` field to the json-v1 trace format. If a given command spans multiple lines, the `line_end` field will contain the line of the last line spanned by the command (that of the closing parenthesis associated to the command).
* | Merge topic 'genex-LINK_LIBRARY-to-decorate-library'Brad King2022-02-091-0/+25
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2a6b0415d7 $<LINK_LIBRARY>: Add LINK_LIBRARY_OVERRIDE target property 42965799b4 Genex: Add $<LINK_LIBRARY:...> 78dd7d5292 cmRulePlaceholderExpander: add base class for placeholder expansion reuse 4b55828a9f cmExpandListWithBacktrace: add handling of empty elements. 28d7432468 cmComputeLinkInformation: use cmComputeLinkDepends::LinkEntry Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6769
| * | Genex: Add $<LINK_LIBRARY:...>Marc Chevrier2022-02-071-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | This generator expression offers the capability, for the link step, to decorate libraries with prefix/suffix flags and/or adding any specific flag for each library. Fixes: #22812, #18751, #20078, #22703
* | | Trace: add global_frame field to json-v1 formatBraulio Valdivielso Martinez2022-02-071-0/+2
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tools using the json-v1 format might want to trace stack frames across different `CMakeLists.txt` files, in order to, for example, provide stacktraces that span from the top-level `CMakeLists.txt` in a project. One would think that `frame` lets you do that, but it doesn't, because it tells you the depth of the stack within the current `CMakeLists.txt`, so it gets reset across calls to `add_subdirectory`. The solution involves adding a field with a "global frame". This value gets incremented on calls to `add_subdirectory`, which makes it easier for tools to reconstruct "global stacktraces". I considered changing the current "frame" value, but I didn't because it would be a breaking change. I cannot think of any use-case where "frame" is more useful to "global-frame", but maybe I'm missing something.
* | Add deprecation warnings for policies CMP0097 and belowBrad King2022-02-031-2/+4
|/ | | | | | | The OLD behaviors of all policies are deprecated, but only by documentation. Add an explicit deprecation diagnostic for policies introduced in CMake 3.16 and below to encourage projects to port away from setting policies to OLD.
* cmListFileCache: Rename FromCommandContext to FromListFileFunctionBrad King2022-01-251-1/+1
| | | | Accept a `cmListFileFunction` instead of a `cmCommandContext`.
* cmCustomCommand: Track main dependency explicitlyNAKAMURA Takumi2021-12-141-9/+6
| | | | | | | Store the main dependency as the first entry in the dependency list plus a boolean member indicating its existence. Note that this slightly changes existing behavior: the main dependency was previously the last entry of the dependency list.
* cmListFileBacktrace: Remove unused "bottom" entryBrad King2021-12-081-1/+0
| | | | | All uses of `GetBottom` by clients have been removed, so drop the method and its supporting infrastructure.
* Merge topic 'env-init-configs'Brad King2021-11-231-1/+2
|\ | | | | | | | | | | | | | | 5b1ed2a646 try_compile: Do not use CMAKE_BUILD_TYPE or CMAKE_CONFIGURATION_TYPES env vars Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !6755
| * try_compile: Do not use CMAKE_BUILD_TYPE or CMAKE_CONFIGURATION_TYPES env varsBrad King2021-11-221-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since: * commit e216b9bbd3 (cmake: Allow CMAKE_BUILD_TYPE to be set by environment variable, 2021-06-29, v3.22.0-rc1~503^2~1) * commit ef56eefc9b (cmake: Allow CMAKE_CONFIGURATION_TYPES to be set by environment variable, 2021-06-29, v3.22.0-rc1~503^2) the environment variables are supposed to provide defaults for settings the user otherwise can control via cache entries. However, they accidentally affect `try_compile` projects too, which are supposed to be programmatically controlled. Fixes: #22935
* | cmMakefile: Simplify Add*Command and adopt to cmAddCustom*CommandNAKAMURA Takumi2021-11-181-92/+34
| |
* | cmMakefile: Simplify detail:::Add{Custom,Utility}CommandNAKAMURA Takumi2021-11-181-41/+64
| | | | | | | | | | | | | | | | | | Note 1: `detail::AddCustomCommandToTarget()` resets cc, since cc is not moved away. Note 2: In `detail::AddUtilityCommand()`, a few vars are preserved before using. Their refs will be alive in most cases, but cc might be destroyed in the future.
* | cmMakefile: Introduce GeneratorAction as the class.NAKAMURA Takumi2021-11-181-2/+8
| |
* | cmMakefile: Move CMP0116 lookup into Add{Custom,Utility}CommandNAKAMURA Takumi2021-11-181-22/+22
| | | | | | | | Avoid repeating it at every call site.
* | Source: Replace most calls to sprintf with snprintfSean McBride2021-10-251-2/+2
| |
* | Add deprecation warnings for policies CMP0094 and belowBrad King2021-10-081-2/+3
|/ | | | | | | The OLD behaviors of all policies are deprecated, but only by documentation. Add an explicit deprecation diagnostic for policies introduced in CMake 3.15 and below to encourage projects to port away from setting policies to OLD.
* cmMakefile: Fix compilation on EDG-based compilers such as LCCmakise-homura2021-10-011-5/+4
| | | | | | | | | | Compilers based on EDG frontend sometimes throw an internal error while using `this->` at some circumstances. While it is up to be fixed in future versions of front end, this bug still occurs in some modern compilers, such as LCC for Elbrus CPUs, and probably others (maybe ICC). It caused CMake to be unbuildable by these compilers. This patch fixes it.
* Source: Fix clang -Wimplicit-fallthrough warningsSean McBride2021-09-281-4/+11
|
* Rename cmProp in cmValueMarc Chevrier2021-09-211-40/+41
|
* remove cmToCStr functionMarc Chevrier2021-09-191-2/+2
|
* cmSystemTools::VersionCompare: use std::string for argumentsMarc Chevrier2021-09-171-2/+1
|
* Merge topic 'enh-AddCacheEntry-accepts-new-types'Marc Chevrier2021-09-101-4/+4
|\ | | | | | | | | | | | | | | f84193292c Use new AddCacheEntry signatures 3c2e58eeb8 AddCacheEntry accept cmProp or std::string Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6495
| * Use new AddCacheEntry signaturesMarc Chevrier2021-09-101-4/+4
| |
* | Refactor: Convert parallel string/backtrace vectors to BT vectorsKyle Edwards2021-09-031-38/+10
|/