summaryrefslogtreecommitdiffstats
path: root/Source/cmSourceFile.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Rename cmProp in cmValueMarc Chevrier2021-09-211-14/+15
|
* Enhancement: SetProperty accept cmProp or std::stringMarc Chevrier2021-08-251-1/+11
| | | | | Methods SetProperty of classes cmPropertyMap, cmStateDirectory and cmMakefile accept now cmProp or std::string as argument.
* cmProp: refactoring: transform alias in classMarc Chevrier2021-08-081-7/+7
| | | | | | 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.
* CMP0118: Fix NEW behavior when looking up target sourcesBrad King2021-03-181-3/+14
| | | | | | | | | | Under the CMP0118 NEW behavior, sources generated in one directory should be visible when added to targets in other directories. This was accidentally left out of commit 6624b65b3f (GENERATED prop: Add implementation for policy CMP0118 being set to NEW, 2020-11-09, v3.20.0-rc1~393^2~1). Fixes: #18399
* clang-tidy: fix `readability-qualified-auto` warningsBen Boeckel2021-01-271-1/+1
|
* GENERATED prop: Add implementation for policy CMP0118 being set to NEWDeniz Bahadir2020-11-241-15/+46
| | | | | | | | | | | | | | | | | | * Adding implementation for policy CMP0118 being set to `NEW`. * Adding new tests for policy CMP0118 being set to `NEW`. * Checking the `GENERATED` property with `get_source_file_property` or `get_property` now always returns exactly `1` or `0`. No other values will be returned. Note, that this is a backwards-incompatible change, even when policy CMP0118 is unset or set to `OLD`. * Additionally, as `get_source_file_property` and `get_property` now always check if a source-file was marked globally visible, even when CMP0118 is unset or set to `OLD`, they possibly return `1` where they might have returned `0` before the changes introduced by this commit. Note, that this is a backwards-incompatible change, even when policy CMP0118 is unset or set to `OLD`. * As a consequence, the tests for policy CMP0118 being unset or set to `OLD` got slightly adjusted, too, to reflect these changes in behavior.
* GENERATED prop: Simplify determining the language of a source fileDeniz Bahadir2020-11-241-9/+7
| | | | | This simplification will help the later following structural changes of class `cmSourceFile`.
* cmSourceFile::GetPropertyForUser: return cmPropVitaly Stakhovsky2020-11-041-9/+10
| | | | also fix GetSafeProperty() return type
* CMP0115: Require source file extensions to be explicitKyle Edwards2020-10-131-16/+45
|
* cmIsOn: add overload accepting const std::string*Vitaly Stakhovsky2020-07-141-2/+1
|
* Refactor file extension queries to be more consistentRobert Maynard2020-06-221-19/+12
| | | | | It was very easy to forgot to check against all language file extensions. This updates the internal API to have a unified API.
* cmSourceFile::GetProperty: return cmPropVitaly Stakhovsky2020-04-141-17/+17
|
* cmMakefile::GetProperty: return cmPropVitaly Stakhovsky2020-04-011-1/+3
|
* cmPropertyMap: Introduce cmProp as return type for GetProperty() functionsVitaly Stakhovsky2020-03-131-2/+3
| | | | | | | Currently properties are usually stored internally as `std::string`. However, family of GetProperty() functions return them as `const char *` using `c_str()`. The proposed `cmProp`, typedef'ed as `const std::string *` will expose properties more naturally.
* AppendProperty: convert value param to std::stringVitaly Stakhovsky2020-01-251-5/+5
|
* cmSourceFile: avoid unnnecessary copiesTim Blechmann2020-01-161-2/+2
| | | | | | the copies in `cmSourceFile::FindFullPath` are one of the hotspots of my build system: we can easily avoid them by capturing by reference instead of by value
* cmSourceFile: Add backtraces for a few source propertiesJustin Goshi2019-09-261-2/+76
| | | | | Adding backtrace support for INCLUDE_DIRECTORIES, COMPILE_OPTIONS, and COMPILE_DEFINITIONS.
* cmSourceFile: Remove non-const GetProperties accessorDaniel Eiband2019-09-211-0/+7
| | | | | | Manipulating the property map of cmSourceFile directly may invalidate the class invariant of the cached value IsGenerated. Provide the setter SetProperties which also updates IsGenerated.
* cmSourceFile: use unique_ptr for CustomCommandTushar Maheshwari2019-09-131-17/+4
|
* cmSourceFile: Rename mutating GetFullPath() overloadDaniel Eiband2019-08-291-3/+3
| | | | Rename mutating GetFullPath() overload to ResolveFullPath().
* cmSourceFile: Move LANGUAGE to GetPropertyForUserTushar Maheshwari2019-08-271-0/+7
| | | | | | | | - Remove the special case from cmGetSourceFilePropertyCommand Tests: check LANGUAGE for source file - use target_sources to add file - use get_property to read property value
* cmSourceFile: Rename non-const GetLanguageTushar Maheshwari2019-08-271-11/+8
| | | | | | | | GetOrDetermineLanguage: - Read the property if available - Determine the Language using the file extension Fix all usage of the non-const member in the repository.
* Source sweep: Use cmStrCat for string concatenationSebastian Holtermann2019-08-221-7/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)`
* Source sweep: Use cmIsOn instead of cmSystemTools::IsOnSebastian Holtermann2019-08-171-2/+3
| | | | | | | | | This replaces invocations of - `cmSystemTools::IsInternallyOn` with `cmIsInternallyOn` - `cmSystemTools::IsNOTFOUND` with `cmIsNOTFOUND` - `cmSystemTools::IsOn` with `cmIsOn` - `cmSystemTools::IsOff` with `cmIsOff`
* cmSourceFile: Check if a file is GENERATED first in the full path computationSebastian Holtermann2019-02-021-5/+5
| | | | | | | In `cmSourceFile::FindFullPath` check first if the file is GENERATED before aborting on `FindFullPathFailed`. This allows recomputation of the full path when the GENERATED property was set after the file path was computed with an error.
* cmSourceFile: Refactor FindFullPath methodSebastian Holtermann2019-02-021-62/+59
| | | | | Refactors the cmSourceFile::FindFullPath method to use lambdas.
* Use cmSourceFile::GetIsGeneratedSebastian Holtermann2019-02-011-1/+1
|
* cmSourceFile: Add IsGenerated methodSebastian Holtermann2019-02-011-2/+10
| | | | | | | All cmSourceFiles are checked at least once whether they're `GENERATED` or not. This adds a convenience method `GetIsGenerated` that returns a private boolean cache variable `IsGenerated`. `IsGenerated` is updated every time the `GENERATED` property is written.
* cmSourceFile: Additional static property stringsSebastian Holtermann2019-02-011-3/+5
|
* Factor out enum MessageType into dedicated headerBruno Manganelli2019-01-161-1/+3
| | | | Reduce the number of files relying on `cmake.h`.
* cmMakefile: return directories as const std::string&Vitaly Stakhovsky2018-08-271-2/+2
|
* Add GetSafeProperty method to cmTarget, cmGeneratorTarget and cmSourceFileSebastian Holtermann2018-07-021-0/+9
|
* Reduce raw string pointers usage.Pavel Solodovnikov2018-01-311-1/+1
| | | | | | | | | | * Change some functions to take `std::string` instead of `const char*` in the following classes: `cmMakeFile`, `cmake`, `cmCoreTryCompile`, `cmSystemTools`, `cmState`, `cmLocalGenerator` and a few others. * Greatly reduce using of `const char*` overloads for `cmSystemTools::MakeDirectory` and `cmSystemTools::RelativePath`. * Remove many redundant `c_str()` conversions throughout the code.
* cmSourceFileLocation: allow skipping ambiguous extensionsBen Boeckel2018-01-101-2/+3
| | | | | | | | | | | The ambiguous extension logic is an old behavior that ends up taking lots of extra compute cycles to execute. This is triggered by various CMake codepaths which pass extension-less paths down when CMake actually knows that they are not ambiguous. These codepaths will be indicated in upcoming changes. Various APIs have gained a cmSourceFileLocationKind parameter, but they are all optional and default to the existing behavior.
* Various typo fixesLuz Paz2018-01-031-1/+1
| | | | Some are user-facing. Others are source comments.
* Meta: modernize old-fashioned loops to range-based `for`.Pavel Solodovnikov2017-09-121-12/+8
| | | | | | Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate.
* cmSourceFile: Avoid unnecessary vector copySebastian Holtermann2017-08-261-4/+4
|
* Use C++11 nullptrDaniel Pfeifer2017-08-241-4/+4
|
* Remove AUTOGEN variables from cmSourceFile and cmMakefileSebastian Holtermann2017-08-221-9/+0
|
* Fix several include-what-you-use findingsDaniel Pfeifer2016-11-081-3/+2
|
* cmListFileCache: Remove cmState header includeStephen Kelly2016-10-191-0/+1
| | | | | Include it in dependents which have previously relied on it transitively.
* cmState: Port dependents to new cmStateTypes headerStephen Kelly2016-10-191-1/+1
|
* Simplify CMake per-source license noticesBrad King2016-09-271-11/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* fix a load of include-what-you-use violationsDaniel Pfeifer2016-09-031-0/+5
|
* CMake: don't use else after returnDaniel Pfeifer2016-08-181-2/+1
|
* use CM_NULLPTRDaniel Pfeifer2016-06-281-4/+4
|
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-126/+82
| | | | | | | | | | | | | Run the `Utilities/Scripts/clang-format.bash` script to update all our C++ code to a new style defined by `.clang-format`. Use `clang-format` version 3.8. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
* Remove `//------...` horizontal separator commentsBrad King2016-05-091-23/+0
| | | | | | | | | | | | | | | | | | | | | | | | Modern editors provide plenty of ways to visually separate functions. Drop the explicit comments that previously served this purpose. Use the following command to automate the change: $ git ls-files -z -- \ "*.c" "*.cc" "*.cpp" "*.cxx" "*.h" "*.hh" "*.hpp" "*.hxx" | egrep -z -v "^Source/cmCommandArgumentLexer\." | egrep -z -v "^Source/cmCommandArgumentParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmDependsJavaLexer\." | egrep -z -v "^Source/cmDependsJavaParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmExprLexer\." | egrep -z -v "^Source/cmExprParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmFortranLexer\." | egrep -z -v "^Source/cmFortranParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmListFileLexer\." | egrep -z -v "^Source/cm_sha2" | egrep -z -v "^Source/(kwsys|CursesDialog/form)/" | egrep -z -v "^Utilities/(KW|cm).*/" | xargs -0 sed -i '/^\(\/\/---*\|\/\*---*\*\/\)$/ {d;}' This avoids modifying third-party sources and generated sources.
* cmake: Store hardcoded lists of sources and headersStephen Kelly2015-10-271-2/+4
| | | | Don't duplicate this in each cmMakefile.
* Remove unused cmLocalGenerator include.Stephen Kelly2015-10-051-1/+0
|