summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGhsMultiGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* cmCustomCommand: Refactor custom command-specific policy valuesKyle Edwards2023-02-061-3/+0
| | | | | | | | | | | | | | | | | Many custom commands are created by CMake itself rather than by the user. These custom commands should always have their policies set to NEW, and user-created custom commands should have their policy values set only from the state snapshot. In addition, we want to genericize the mechanism of recording a policy at the time of custom command creation. Add a CM_FOR_EACH_CUSTOM_COMMAND_POLICY macro to genericize custom command policies. Use this to define all custom command policies. Make all such policies NEW instead of WARN by default. Remove individual policy modifier methods and add a single method that records relevant values from a cmStateSnapshot. Remove the no longer needed explicit policy settings from synthesized custom commands.
* cmValue: Use operator* explicitly to convert to std::string; avoid extra callVitaly Stakhovsky2023-01-161-3/+3
|
* Refactor: `cmGlobalGeneratorFactory::GetDocumentation` returns entryAlex Turbov2022-11-171-5/+5
| | | | | | | | | | Before, a documentation entry was in/out parameter. Now it's a normal return value. This also makes possible to eliminate defaulted default ctor for `cmDocumentationEntry` for C++ 11. Also, simplify `cmake::AppendGlobalGeneratorsDocumentation()`.
* GHS: Fix RERUN_CMAKE issue when generation step failsFred Baksik2022-04-161-9/+8
| | | | Fixes: 23435
* GHS: List predefined targets before user targets in GUIFred Baksik2022-03-171-3/+16
|
* GHS: update build commandFred Baksik2022-03-171-24/+28
| | | | | | | | | | | | | | | | | * Remove unecessary logic for selecting gbuild -- CMake defaults to the Cache entry * Support building multiple targets * Fix error when ctest passes in a vector potentially containing an empty string. -- At minimum build the ALL_BUILD project, never just the Top Project. * Add verbose support * There can only be one top-level project per directory because the project() command can only be used once per directory. Multiple calls of project() only use the last invocation.
* GHS: Rearrange project files in binary directoryFred Baksik2022-03-171-18/+6
| | | | | | | | The top level project and the target projects are all in the same directory so they are easier to find and looks nicer in the GUI. All of the ancillary project files are located in the target subdirectory.
* GHS: Use Custom Target for ALL_BUILDFred Baksik2022-03-171-77/+72
| | | | | | | | Use a Custom Target for ALL_BUILD instead of special code. This also changes the name from <project>.ALL_BUILD.tgt to ALL_BUILD.tgt. The name change is part of standardizing the CMakePredefinedTargets names.
* GHS: Create RERUN_CMAKE Custom TargetFred Baksik2022-03-171-0/+111
| | | | | Create a Custom Target that will re-run CMake on user demand if any of the CMake input files have changed.
* GHS: Fix gbuild job controlFred Baksik2022-03-171-3/+4
| | | | | | gbuild command line is "-parallel[=n]". Fixes: #23252
* cmBuildOptions: Split build arguments into separate object.Carsten Rudolph2022-01-221-1/+2
|
* GHS: Allow setting GHS variables from toolchain fileFred Baksik2021-11-151-19/+10
| | | | | | | | | | | | | | | | | * Update generator to use the current variable definition, not the CACHE definition. * Avoid overwriting toolchain variables and avoid developer warnings when setting up the GHS variables. -- A cache entry is only required when: a) The toolchain uses set( CACHE ) to set the variable b) A -D or preset value was used to set the variable The cache entry is required so that the TYPE gets set properly. -- Avoid the Policy CMP0126 warnings: setting cache variable when normal variable exists * Move GHS_PRIMARY_TARGET back into area so non-GHS generator toolchain file can trigger the OS search.
* GHS: Update BSP selection logicFred Baksik2021-11-151-17/+1
| | | | | | | | | | Selection of a BSP only needs to be performed if not set by user. Remove all the logic for printing error and status messages about BSP selection. These messages also breaks CMake tests. NOTE: If BSP selection fails then the compiler checks will result in a build error. The build error will report that the BSP does not exist.
* GHS: Update RTOS selection logicFred Baksik2021-11-151-27/+3
| | | | | | | | | | | | | | | Selection of an RTOS only needs to be performed if not set by user. Avoid CMake developer warnings for setting GHS_OS_DIR multiple times. Instead only set it once after searching has been performed. Remove all the logic for printing error and status messages about RTOS selection. This was broken and reporting incorrect messages. These messages also breaks CMake tests. NOTE: If RTOS selection fails then the compiler checks will result in a build error. The build error will report that the RTOS "GHS_OS_DIR-NOT-SPECIFIED" does not exist.
* GHS: Update toolset selection logicFred Baksik2021-11-151-42/+46
| | | | | | | | | | | | | -- Ensure that GHS_TOOLSET_ROOT is used as a path * Converts directory path slashes to CMake style -- Use ComparePath() to properly check for path changes of build tool * Accounts for Windows file-system case insensitivity. -- Don't print message "defaulting" messages (this causes CMake test failures) -- Don't force update CMAKE_GENERATOR_TOOLSET back into cache when `-T` is not used on initial configure. This change avoids an unnessary error message when accidentally using `-T` in subsequent runs but the same tools are always used. -- Use IssueMessage() for error messages.
* GHS: Update selection of primaryTarget in MULTI project fileFred Baksik2021-11-151-37/+21
| | | | | | | | | | | | | | | Changes to ``-A`` handling: * Don't force CMAKE_GENERATOR_PLATFORM into cache when using default value (breaks using CMake presets). * Don't print message when using default value (breaks CMake tests). Changes to ``GHS_PRIMARY_TARGET`` handling: * Add as a cache variable so its known to GUI * Don't always include``GHS_TARGET_PLATFORM``, it's only needed if ``GHS_PRIMARY_TARGET`` wasn't set by the user. * Set ``GHS_PRIMARY_TARGET`` during platform selection instead of when a language is enabled. By performing this sooner ``GHS_TARGET_PLATFORM`` is not always required to be set into cache.
* Rename cmProp in cmValueMarc Chevrier2021-09-211-13/+13
|
* cmProp: refactoring: transform alias in classMarc Chevrier2021-08-081-2/+1
| | | | | | To handle safely the values used by CMake variables and properties, introduce the class cmProp as a replacement from the simple pointer to std::string instance.
* cmGlobalGhsMultiGenerator: Simplify relative path conversion logicBrad King2021-05-121-4/+4
| | | | | Our call to `MaybeConvertToRelativePath` uses paths that always pass the "maybe" checks. Use `ForceToRelativePath` directly.
* clang-tidy: fix `readability-qualified-auto` warningsBen Boeckel2021-01-271-1/+1
|
* Code style: add missed explicit 'this->'Oleksandr Koval2021-01-051-8/+8
| | | | | CMake uses explicit 'this->' style. Using custom clang-tidy check we can detect and fix places where 'this->' was missed.
* Constify some code as suggested by clang-tidyCengizhan Pasaoglu2020-10-191-2/+2
|
* cmake::GetCacheDefinition: Return cmPropvvs314152020-09-281-19/+17
|
* cmMakefile::GetDefinition: return cmPropVitaly Stakhovsky2020-09-021-6/+7
|
* Source: use cmNonempty()Vitaly Stakhovsky2020-07-281-3/+4
|
* Factor out generator checks for filtering out interface librariesBrad King2020-07-231-1/+1
| | | | | | Add a `cmGeneratorTarget::IsInBuildSystem` helper method to tell generators whether a target should participate in the generated build system.
* Allow generator expressions in the EXCLUDE_FROM_ALL target propertyJoerg Bornemann2020-07-211-1/+1
| | | | | | | | | This allows for setting EXCLUDE_FROM_ALL, conditional on the build configuration. However, only the Ninja Multi-Config generator supports different property values per config. All other multi-config generators will yield an error in that situation. Fixes: #20923
* Merge topic 'cmnonempty'Kyle Edwards2020-07-151-1/+1
|\ | | | | | | | | | | | | eaad8072ee cmNonempty: Convenience inlines to check for non-empty string Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5017
| * cmNonempty: Convenience inlines to check for non-empty stringVitaly Stakhovsky2020-07-141-1/+1
| |
* | cmIsOn: add overload accepting const std::string*Vitaly Stakhovsky2020-07-141-2/+1
|/
* Single location for cmProp typedefVitaly Stakhovsky2020-06-011-0/+1
|
* cmGeneratorTarget::GetProperty: return cmPropVitaly Stakhovsky2020-04-291-5/+6
|
* Refactoring: add cm::contains to <cmext/algorithm>Marc Chevrier2020-04-171-3/+3
|
* Refactor: Avoid `std::endl` where it's not necessary (part 3)Alex Turbov2020-03-241-36/+39
| | | | | | | | | | | | The `std::endl` manipulator, except inserting `\n` character, also performs `os.flush()`, which may lead to undesired effects (like disk I/O in the middle of forming data strings). For the `std::stringstream` it also has no meaning. * replace multiple `operator<<` calls on a string literal w/ the only call and the only (bigger) string literal; * replace one character string literal used in `operator<<` w/ a char literal.
* cmMakefile::AddCacheDefinition: Add overload that accepts std::string valueVitaly Stakhovsky2020-03-111-5/+5
|
* GHS: Use cm::erase in place of loopVitaly Stakhovsky2020-03-101-10/+6
|
* cmLocalGenerator: modernize memory managementMarc Chevrier2019-12-091-3/+6
|
* cmake: Teach --build mode to load CMAKE_GENERATOR_TOOLSETAlexander Boczar2019-10-151-1/+4
| | | | | Extend the `cmGlobalGenerator::SetGeneratorToolset` signature to indicate when it is called from `cmake::build`.
* Revise include order using clang-format-6.0Kitware Robot2019-10-011-6/+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.
* clang-tidy: modernize-deprecated-headersRegina Pfeifer2019-09-161-1/+1
|
* Source sweep: Replace cmExpandList with the shorter cmExpandedListSebastian Holtermann2019-08-231-2/+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-39/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-4/+3
|\ | | | | | | | | | | | | | | | | 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-4/+3
| | | | | | | | Also, use the new function where applicable.
* | Source sweep: Use cmIsOn instead of cmSystemTools::IsOnSebastian Holtermann2019-08-171-10/+7
|/ | | | | | | | | 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-1/+1
|
* clang-tidy: Enable performance-inefficient-string-concatenationSebastian Holtermann2019-08-051-5/+6
| | | | | | | Enables the clang-tidy test performance-inefficient-string-concatenation and replaces all inefficient string concatenations with `cmStrCat`. Closes: #19555
* cmMakefile: Let AddDefinition accept a value as cm::string_viewSebastian Holtermann2019-07-241-1/+1
| | | | | | | | | | | | | | | | 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.
* GHS: Update ExternalProject for GHS toolsFred Baksik2019-04-111-1/+1
| | | | | | | | | -- When using default values for the external project forward GHS platform variables so that the external project builds with the same tools as the original project. -- Fix issue with bad top level project when GHS_PRIMARY_TARGET is set but has no value. In this case treat it as unset and use default value.
* GHS: Update project layout to accommodate gbuild inconsistenciesFred Baksik2019-04-111-106/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- Do not use reference projects, use build hierarchy instead. gbuild has three parallel levels: * low -- Parallelizes compiling source files within a single project (.gpj) file when safe to do so. * medium -- Parallelizes processing files within a single linked output when safe to do so. * high [default] -- Parallelizes processing files whenever safe to do so, including linking task. Testing showed that for some combinations of gbuild / MULTI there are issues with building a project that uses references to target project files along with using {nobuild} option. Sometimes the archiving of a library and linking of an executable were happening in parallel and the build would fail when linking because the archive wasn't complete. This behavior was also inconsistent when running the build from MULTI and from the command line with gbuild. In some cases MULTI did not parallelize archiving and linking, but gbuild performed these actions in parallel. The parallel build issue was not seen when using a build hierarchy where the project listed the project files normally instead of using a reference link. The other option was to add the -parallel_level=medium to the command line when using "cmake --build" but this wouldn't fix the issue if gbuild itself was used to and the user might not be aware of the extra option used by cmake.