summaryrefslogtreecommitdiffstats
path: root/Source/cmCommonTargetGenerator.h
Commit message (Collapse)AuthorAgeFilesLines
* cmCommonTargetGenerator: return forward linked target dirs tooBen Boeckel2023-11-211-2/+9
| | | | | This will be used for module forwarding in order to support `$<TARGET_OBJECTS>` usage in source and link libraries calls.
* TargetGenerator: Factor out generation of code check rulesOrkun Tokdemir2023-05-161-0/+10
| | | | | | | | De-duplicate code check rule generation in Ninja and Makefile generators by moving their implementation to `cmCommonTargetGenerator`. Previously Ninja was generating code check rules per language. It was changed to generate code check rules for each source file.
* cmCommonTargetGenerator: classify linked target directories by languageBen Boeckel2023-02-011-1/+1
| | | | | | | | | | | | | | | | | | | These directories are used to direct collators for Fortran and C++ modules to consume dependent module information to properly collate. However, the consumption of these files merely checks for existence of the file, not whether they are actually needed anymore. The problem arises when a target has Fortran or C++ modules at point A, a build occurs populating this file, and then the target is updated to no longer have potential modules. The `DependInfo.make` (for `Makefiles`) or `<LANG>DependInfo.json` (for `Ninja`) files still exist as they are never guaranteed to be cleaned up. This can introduce stale information to the build which may cause a false-positive compilation if a module file happens to still exist and gets found this way. Instead, query the `linked-target-dirs` using the language in question and only add the directory if it contains potential sources for modules coming from the language in question.
* cmLocalGenerator: Adopt AppendModuleDefinitionFlag methodBrad King2022-05-311-5/+0
| | | | Migrate from `cmCommonTargetGenerator::AddModuleDefinitionFlag`.
* Provide guidance when trying to use non-enabled languageRobert Maynard2022-05-041-0/+4
| | | | Fixes #23463
* Ninja: Avoid preprocessing twice with explicit Fortran_PREPROCESSPeter Hill2022-02-241-2/+8
| | | | | | Fix spurious warnings from gfortran+Ninja for preprocessing. Fixes: #23248
* Rename cmProp in cmValueMarc Chevrier2021-09-211-2/+2
|
* Refactor: cmCommonTargetGenerator::GetFeature returns cmPropMarc Chevrier2021-08-091-2/+3
|
* LINK_WHAT_YOU_USE feature: externalize configurationMarc Chevrier2021-07-091-0/+1
| | | | | | | | Currently, this feature is only supported on ELF platforms. So, the property LINK_WHAT_YOU_USE will be ignored for other plateforms. Moreover, flags and commands are now controled by CMake variables. Fixes: #20174
* Launchers: Support setting linker launchersBobby D Reynolds2021-05-281-0/+2
| | | | Fixes: #18316
* Modernize: Use #pragma once in all header filesKitware Robot2020-09-031-4/+1
| | | | | | | | | | | | | | | | #pragma once is a widely supported compiler pragma, even though it is not part of the C++ standard. Many of the issues keeping #pragma once from being standardized (distributed filesystems, build farms, hard links, etc.) do not apply to CMake - it is easy to build CMake on a single machine. CMake also does not install any header files which can be consumed by other projects (though cmCPluginAPI.h has been deliberately omitted from this conversion in case anyone is still using it.) Finally, #pragma once has been required to build CMake since at least August 2017 (7f29bbe6 enabled server mode unconditionally, which had been using #pragma once since September 2016 (b13d3e0d)). The fact that we now require C++11 filters out old compilers, and it is unlikely that there is a compiler which supports C++11 but does not support #pragma once.
* Fortran: Add Fortran_PREPROCESS propertyPeter Hill2020-05-211-0/+3
| | | | Issue: #18870
* PCH: Add support for multi architecture iOS projectsCristian Adam2020-04-021-1/+2
| | | | Fixes: #20497
* AIX: Add an option to disable automatic exports from shared librariesBrad King2020-01-311-0/+1
| | | | | | | | | | Since commit 0f150b69d3 (AIX: Explicitly compute shared object exports for both XL and GNU, 2019-07-11, v3.16.0-rc1~418^2~2) we always export all symbols from shared libraries by default. Add a new target property called `AIX_EXPORT_ALL_SYMBOLS` that can be explicitly set to OFF to suppress this behavior and export no symbols by default. Fixes: #20290
* Ninja: Add multi-config variantKyle Edwards2019-12-131-4/+10
| | | | Co-Authored-by: vector-of-bool <vectorofbool@gmail.com>
* Refactor: Prepare Ninja generator for multi-configKyle Edwards2019-12-131-12/+14
|
* clang-tidy: Replace typedef with usingRegina Pfeifer2019-09-041-1/+1
| | | | | | | | Automate the conversion with perl -i -0pe 's/typedef ([^;]*) ([^ ]+);/using $2 = $1;/g' then manually fix a few places.
* cmCommonTargetGenerator: Rename member to avoid shadowingBrad King2017-06-141-2/+2
| | | | | | Rename the `LocalGenerator` and `GlobalGenerator` members to avoid shadowing similar members in subclasses that use more-specific pointer types.
* Inline and remove AddFeatureFlags methodBrad King2017-04-271-3/+0
| | | | | The method implementation is now only one call of another method, so inline it at call sites and remove it.
* Use quotes for non-system includesDaniel Pfeifer2017-04-111-1/+1
| | | | | | | | | | | | | Automate with: git grep -l '#include <cm_' -- Source \ | xargs sed -i 's/#include <\(cm_.*\)>/#include "\1"/g' git grep -l '#include <cmsys/' -- Source \ | xargs sed -i 's/#include <\(cmsys\/.*\)>/#include "\1"/g' git grep -l '#include <cm[A-Z]' -- Source \ | xargs sed -i 's/#include <\(cm[A-Z].*\)>/#include "\1"/g'
* cmConfigure: Ensure separate include block in headersDaniel Pfeifer2017-04-111-0/+1
| | | | | | | | | | | Make sure that `#include <cmConfigure.h>` is followed by an empty line in header files. This is necessary to make sure that changing <> to "" does not affect the include ordering of clang-format. Automate with: git grep -l '#include <cmConfigure.h>' | grep -v '.cxx$' \ | xargs sed -i '/#include <cmConfigure.h>/ { N; N; s/\n\{1,2\}/\n\n/ }'
* Refactoring: s,GetFeatureAsBool,IsIPOEnabled,Ruslan Baratov2017-03-301-1/+0
| | | | | Method 'GetFeatureAsBool' is used only with 'INTERPROCEDURAL_OPTIMIZATION' feature. Substituting 'GetFeatureAsBool' with 'IsIPOEnabled'.
* Refactor module definition file selectionBrad King2017-03-091-3/+0
| | | | | | Create a `ModuleDefinitionInfo` structure for each configuration of a target to hold corresponding information about the selected module definition file (`.def` source).
* Makefile,Ninja: De-duplicate MSVC compiler PDB path selectionBrad King2016-12-151-0/+1
| | | | | Add a helper to cmCommonTargetGenerator instead of duplicating it in cmMakefileTargetGenerator and cmNinjaTargetGenerator.
* Fix several include-what-you-use findingsDaniel Pfeifer2016-11-081-4/+1
|
* cmLinkLineComputer: Extract from cmLocalGeneratorStephen Kelly2016-10-101-1/+3
| | | | | | | | | | | CMake has several classes which have too many responsibilities. cmLocalGenerator is one of them. Start to extract the link line computation. Create generator-specific implementations of the interface to account for generator-specific behavior. Unfortunately MSVC60 has different behavior to everything else and CMake still generates makefiles for it. Isolate it with MSVC60-specific names.
* 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.
* cmOutputConverter: Remove now-obsolete Convert methodStephen Kelly2016-09-191-4/+0
|
* Convert: Remove UNCHANGED enum valueStephen Kelly2016-08-271-3/+3
| | | | It is no longer used.
* fix a batch of include-what-you-use violationsDaniel Pfeifer2016-08-231-2/+6
|
* cmLocalGenerator: Add method to get Fortran-specific compiler flagsBrad King2016-06-171-3/+0
| | | | | | | | | | Add a cmLocalGenerator::GetTargetFortranFlags virtual method to get generator-specific generation of Fortran-specific flags. Implement it in cmLocalCommonGenerator by moving the implementation from cmCommonTargetGenerator::AddFortranFlags. This will allow it to be used without having a target generator available. Inspired-by: Tobias Hunger <tobias.hunger@qt.io>
* cmGeneratorTarget: Adopt Fortran module directory generationTobias Hunger2016-06-171-6/+0
| | | | | | | | | Move code to create/get the fortran module directory from the cmCommonTargetGenerator to cmGeneratorTarget. Rename the ComputeFortranModuleDirectory method to CreateFortranModuleDirectory as this method *creates* the directory if it is missing.
* Refactor Makefile/Ninja tool working directory storageBrad King2016-06-171-3/+1
| | | | | Move cmCommonTargetGenerator::WorkingDirectory to cmLocalCommonGenerator and add an access method.
* cmLocalGenerator: Adopt GetFrameworkFlags methodTobias Hunger2016-06-091-3/+0
| | | | Move it from cmCommonTargetGenerator.
* Use enums defined in cmOutputConverter using their fully qualified name.Daniel Pfeifer2016-05-251-2/+2
| | | | | | | | | Mostly automated: values=("RelativeRoot" "NONE" "FULL" "HOME" "START" "HOME_OUTPUT" "START_OUTPUT" "OutputFormat" "UNCHANGED" "MAKERULE" "SHELL" "WATCOMQUOTE" "RESPONSE" "FortranFormat" "FortranFormatNone" "FortranFormatFixed" "FortranFormatFree") for i in "${values[@]}"; do git grep -l cmLocalGenerator::$i | xargs sed -i "s|cmLocalGenerator::$i|cmOutputConverter::$i|g"; done
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-7/+5
| | | | | | | | | | | | | 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.
* cmCommonTargetGenerator: Adopt AppendOSXVerFlag methodBruce Stephens2016-03-071-0/+3
| | | | | | | Move this method from cmMakefileLibraryTargetGenerator so it can be re-used for the Ninja generator too. Signed-off-by: Bruce Stephens <bruce.r.stephens@gmail.com>
* Refactor `.def` file lookupTim Grothe2015-11-041-1/+1
| | | | | Return a `cmSourceFile const*` from GetModuleDefinitionFile so that callers can get more information than just the path to the file.
* Makefiles: Port to cmGeneratorTarget.Stephen Kelly2015-10-241-2/+0
|
* Add support for *.manifest source files with MSVC toolsBrad King2015-09-171-0/+1
| | | | | | | | Classify .manifest sources separately, add dependencies on them, and pass them to the MS manifest tool to merge with linker-generated manifest files. Inspired-by: Gilles Khouzam <gillesk@microsoft.com>
* cmCommonTargetGenerator: Factor out Fortran module directory computationBrad King2015-07-291-0/+1
| | | | | Move computation from GetFortranModuleDirectory to a virtual method so it can be customized for each type of generator.
* cmCommonTargetGenerator: Store working directory for relative pathsBrad King2015-07-291-1/+3
| | | | | | | | The Makefile generators run tools with the current working directory set to the subdirectory of the build tree for the each target. The Ninja generator runs tools with the current working directory set to the top of the build tree. Tell cmCommonTargetGenerator where the working directory will be so it can compute proper relative paths.
* cmCommonTargetGenerator: Return string from GetFortranModuleDirectoryBrad King2015-07-291-1/+1
|
* cmCommonTargetGenerator: Adopt linked target directory computationBrad King2015-07-281-0/+2
| | | | | | Factor a GetLinkedTargetDirectories method out of cmMakefileTargetGenerator::WriteTargetDependRules to compute the list of directories associated with targets to which the current target links.
* Factor an <INCLUDES> placeholder out of <FLAGS> in rule variablesBrad King2015-07-131-0/+2
| | | | | | | | | | | Teach the Makefile and Ninja generators to substitute for an <INCLUDES> placeholder instead of putting -I in <FLAGS>. Update our values for CMAKE_<LANG>_COMPILE_OBJECT, CMAKE_<LANG>_CREATE_ASSEMBLY_SOURCE, and CMAKE_<LANG>_CREATE_PREPROCESSED_SOURCE to place <INCLUDES> just before <FLAGS>.
* cmCommonTargetGenerator: Adopt GetDefines methodBrad King2015-07-091-0/+2
| | | | | Move the member up from cmMakefileTargetGenerator so it can be re-used later by cmNinjaTargetGenerator.
* cmCommonTargetGenerator: Adopt GetFlags methodBrad King2015-07-091-0/+7
| | | | | De-duplicate per-target flag computation in Makefile and Ninja target generators.
* cmCommonTargetGenerator: Adopt GetFrameworkFlagsBrad King2015-07-091-0/+3
| | | | Move the member up from cmMakefileTargetGenerator.
* cmCommonTargetGenerator: Adopt AppendFortranFormatFlagsBrad King2015-07-091-0/+4
| | | | Move up from cmMakefileTargetGenerator.
* cmCommonTargetGenerator: Adopt AddFortranFlags and friendsBrad King2015-07-091-0/+8
| | | | | Move AddFortranFlags, GetFortranModuleDirectory, and supporting members up from cmMakefileTargetGenerator.